Showing posts with label Xcode. Show all posts
Showing posts with label Xcode. Show all posts

Monday, April 18, 2011

iphone error: expected '=', ',', ';', 'asm' or '__attribute__' before error

Noted that this error happened only for the NSString*, for e.g.,
  • extern double const kTimeout; // fine
  • extern NSString* const kImageType; // compile error
After the above analysis & little break, eventually the problem is resolved by adding the the following import to the .h - "Foundation/Foundation.h"

Source:http://stackoverflow.com/questions/990906/iphone-error-expected-asm-or-attribute-before-foo

Friday, April 1, 2011

Objective-c Getting Started ".objc_class_name_NSObject", referenced from

Following the http://www.otierney.net/objective-c.html#gettingstarted tutorial, I got the following error:

".objc_class_name_NSObject", referenced from:
.objc_class_name_Fraction in Fraction.o
"_objc_msgSend", referenced from:

It was caused because there was missing a link to a framework: "Foundation.framework".

So, you can add existing frameworks to you project in XCode4 following these steps:

  1. In the project navigator, select your project
  2. Double click your target
  3. Select the 'Build Phases' tab
  4. Open 'Link Binaries With Libraries' expander
  5. Click the '+' button
  6. Select your framework (Foundation.framework)
Done.

references:
http://forums.macnn.com/79/developer-center/391122/newby-trying-learn-obj-c-xcode/
http://stackoverflow.com/questions/3352664/how-to-add-existing-frameworks-in-xcode-4

Friday, February 25, 2011

Code Sign error: Provisioning profile can't be found

In XCode, in the "Groups & Files" pane, expand "Targets" and double-click on your app's target.

This will bring up the Info pane for your target. In the "Build" section, check the "code signing" section for any old profiles. I found that it was building to an old profile there.

Source: http://www.iphonedevsdk.com/forum/iphone-sdk-development/21137-updated-3-0-now-provisioning-profile-cant-found.html

Thursday, February 17, 2011

"_OBJC_CLASS_$_MFMailComposeViewController", referenced from: __objc_classrefs__DATA@0 in libQCLib.a(ShowEmailEditorVCO.o) ld: symbol(s) not found


If you get his error trying to build and run.... 

"_OBJC_CLASS_$_MFMailComposeViewController", referenced from:
      __objc_classrefs__DATA@0 in libQCLib.a(ShowEmailEditorVCO.o)
ld: symbol(s) not found

Just Try adding the MessageUI framework to your project. :P

Source: http://groups.google.com/group/quickconnectiPhone/browse_thread/thread/1b676c17fd09de03

Friday, February 11, 2011

pjs : red labeled libs on device folder on existing project

When I tried to use some psj lib from a project that already had some libs configured, but they were missing:


I noticed that the pjs libs were ther, but with a little difference: 10 instead 9 .I mean, ie. there was libg7221codec-arm-apple-darwin10.a on the /Users/jhonjairoroa87/Downloads/pjproject-svn/third_party/lib path, but the project was looking for libg7221codec-arm-apple-darwin9.am so I made it simple, I duplicated the libs folder with the name libs2 and change "9" to "10" in all the "libs" folder file names:






Building error : Undefined symbols: "_speex_bits_init", referenced from:

Undefined symbols:
  "_speex_bits_init", referenced from:
      _spx_codec_open in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _spx_codec_open in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
  "_speex_bits_destroy", referenced from:
      _spx_codec_close in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _spx_codec_close in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
  "_srtp_unprotect_rtcp", referenced from:
      _srtp_rtcp_cb in libpjmedia-arm-apple-darwin10.a(transport_srtp.o)
  "_srtp_protect_rtcp", referenced from:
      _transport_send_rtcp2 in libpjmedia-arm-apple-darwin10.a(transport_srtp.o)
  "_srtp_deinit", referenced from:
      _pjmedia_srtp_deinit_lib in libpjmedia-arm-apple-darwin10.a(transport_srtp.o)
  "_speex_decoder_destroy", referenced from:
      _spx_codec_close in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
  "_speex_nb_mode", referenced from:
      _speex_nb_mode$non_lazy_ptr in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
     (maybe you meant: _speex_nb_mode$non_lazy_ptr)
  "_speex_mode_query", referenced from:
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
  "_speex_bits_nbytes", referenced from:
      _spx_codec_encode in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
  "_speex_bits_read_from", referenced from:
      _spx_codec_parse in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _spx_codec_decode in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
  "_speex_decoder_init", referenced from:
      _spx_codec_open in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
  "_speex_bits_remaining", referenced from:
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
  "_crypto_get_random", referenced from:
      _generate_crypto_attr_value in libpjmedia-arm-apple-darwin10.a(transport_srtp.o)
  "_srtp_dealloc", referenced from:
      _pjmedia_transport_srtp_stop in libpjmedia-arm-apple-darwin10.a(transport_srtp.o)
      _pjmedia_transport_srtp_stop in libpjmedia-arm-apple-darwin10.a(transport_srtp.o)
      _pjmedia_transport_srtp_start in libpjmedia-arm-apple-darwin10.a(transport_srtp.o)
  "_speex_encoder_destroy", referenced from:
      _get_speex_info in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _spx_codec_close in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
  "_srtp_create", referenced from:
      _pjmedia_transport_srtp_start in libpjmedia-arm-apple-darwin10.a(transport_srtp.o)
      _pjmedia_transport_srtp_start in libpjmedia-arm-apple-darwin10.a(transport_srtp.o)
     (maybe you meant: _pjmedia_transport_srtp_create)
  "_speex_encoder_init", referenced from:
      _get_speex_info in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _spx_codec_open in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
  "_octet_string_hex_string", referenced from:
      _pjmedia_transport_srtp_start in libpjmedia-arm-apple-darwin10.a(transport_srtp.o)
      _pjmedia_transport_srtp_start in libpjmedia-arm-apple-darwin10.a(transport_srtp.o)
  "_speex_lib_get_mode", referenced from:
      _pjmedia_codec_speex_init in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _pjmedia_codec_speex_init in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
  "_speex_decoder_ctl", referenced from:
      _spx_codec_open in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _spx_codec_open in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _spx_codec_modify in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
  "_speex_bits_reset", referenced from:
      _spx_codec_encode in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
  "_speex_encoder_ctl", referenced from:
      _get_speex_info in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _get_speex_info in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _get_speex_info in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _get_speex_info in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _get_speex_info in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _get_speex_info in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _get_speex_info in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _get_speex_info in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _spx_codec_open in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _spx_codec_open in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _spx_codec_open in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _spx_codec_open in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _spx_codec_open in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _spx_codec_modify in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _spx_codec_modify in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
  "_speex_decode_int", referenced from:
      _spx_codec_decode in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _spx_codec_recover in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
  "_srtp_unprotect", referenced from:
      _srtp_rtp_cb in libpjmedia-arm-apple-darwin10.a(transport_srtp.o)
      _srtp_rtp_cb in libpjmedia-arm-apple-darwin10.a(transport_srtp.o)
  "_speex_encode_int", referenced from:
      _spx_codec_encode in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
  "_srtp_protect", referenced from:
      _transport_send_rtp in libpjmedia-arm-apple-darwin10.a(transport_srtp.o)
  "_speex_bits_advance", referenced from:
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _spx_codec_decode in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
  "_srtp_init", referenced from:
      _pjmedia_srtp_init_lib in libpjmedia-arm-apple-darwin10.a(transport_srtp.o)
     (maybe you meant: _pjmedia_srtp_init_lib)
  "_speex_bits_unpack_unsigned", referenced from:
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
  "_speex_bits_write", referenced from:
      _spx_codec_encode in libpjmedia-codec-arm-apple-darwin10.a(speex_codec.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status




print screen of the error:


I solved the proble importing the missing .a libs:

On Xcode: project -> frameworks -> device (right click) -> add -> existing file 





select the lib on your pjs folder ie : /Users/jhonjairoroa87/Downloads/pjproject-svn/third_party/lib/libspeex-arm-apple-darwin10.a





Wednesday, February 9, 2011

Base SDK Missing

I fixed this problem by doing two things. First. choose Project --> Edit PRoject Settings. When a dialog appears, click the Build tab and change the value in the Base SDK option.

Second, choose Project --> Edit Active Target. When a dialog appears, click the Build tab and change the Base SDK option again.

In both cases, I changed it to iPhone 4.0 and rebuilt the project and it worked.

Source: http://www.iphonedevsdk.com/forum/iphone-sdk-development/47369-base-sdk-missing.html

Monday, February 7, 2011

Code Sign error: The identity doesn't match any valid certificate/private key pair in the default keychain

Importing a project from someone else (say downloaded from the internet) and their old certificate info is cached as part of the xcode project. For me, it wasn’t accessible through xcode, steps I used to fix it:
1) Quit Xcode. 2) Right click on your xcodeproj file, select view Package contents. 3) Edit project.pbxproj
Search for CODE_SIGN_IDENTITY and change the certificate info to your own. Do the sameoperation with PROVISIONING_PROFILE lines

Sources: http://www.mmisoftware.co.uk/weblog/2009/08/30/iphone-code-signing-problems-when-debugging/

http://stackoverflow.com/questions/1074546/the-executable-was-signed-with-invalid-entitlements