tags:

views:

810

answers:

3

My app seemingly runs fine in the simulator but the first time I hooked a phone up to my system and had it build for it I got a huge error log with things like:

Build SCCUI of project SCCUI with configuration Debug

CompileXIB HandleAlert.xib
cd /Users/gdbriggs/Desktop/SCCUI
setenv IBC_MINIMUM_COMPATIBILITY_VERSION 3.1
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr
/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/usr/bin/ibtool --errors --warnings --notices --output-format human-readable-text --compile
/Users/gdbriggs/Desktop/SCCUI/build/Debug-iphoneos/SCCUI.app/HandleAlert.nib /Users/gdbriggs/Desktop/SCCUI/HandleAlert.xib

/* com.apple.ibtool.document.warnings */
/Users/gdbriggs/Desktop/SCCUI/HandleAlert.xib:13: warning: UITextView does not support data detectors when the text view is editable.

Ld build/Debug-iphoneos/SCCUI.app/SCCUI normal armv6
cd /Users/gdbriggs/Desktop/SCCUI
setenv IPHONEOS_DEPLOYMENT_TARGET 3.1
setenv MACOSX_DEPLOYMENT_TARGET 10.5
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk -L/Users/gdbriggs/Desktop/SCCUI/build/Debug-iphoneos -F/Users/gdbriggs/Desktop/SCCUI/build/Debug-iphoneos -F/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk/System/Library/Frameworks -filelist /Users/gdbriggs/Desktop/SCCUI/build/SCCUI.build/Debug-iphoneos/SCCUI.build/Objects-normal/armv6/SCCUI.LinkFileList -mmacosx-version-min=10.5 -dead_strip -miphoneos-version-min=3.1 -framework Foundation -framework UIKit -framework CoreGraphics -framework MessageUI -o /Users/gdbriggs/Desktop/SCCUI/build/Debug-iphoneos/SCCUI.app/SCCUI

ld: warning: in /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk/System/Library/Frameworks/Foundation.framework/Foundation, file is not of required architecture
ld: warning: in /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk/System/Library/Frameworks/UIKit.framework/UIKit, file is not of required architecture
ld: warning: in /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics, file is not of required architecture
ld: warning: in /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk/System/Library/Frameworks/MessageUI.framework/MessageUI, file is not of required architecture
Undefined symbols:
  "_OBJC_CLASS_$_UIDevice", referenced from:
      __objc_classrefs__DATA@0 in SCAuthenticationHandler.o
  "_OBJC_CLASS_$_NSString", referenced from:
      __objc_classrefs__DATA@0 in CCProxy.o
      __objc_classrefs__DATA@0 in AlertSummaryViewController.o
      __objc_classrefs__DATA@0 in HomeLevelController.o
      __objc_classrefs__DATA@0 in SCAuthenticationHandler.o
      __objc_classrefs__DATA@0 in SCRequestHandler.o
  "_UIApplicationMain", referenced from:
  _main in main.o
  "_objc_msgSend", referenced from:
      _main in main.o
      _main in main.o
      _main in main.o
      -[SCCUIAppDelegate applicationDidFinishLaunching:] in

and it just keeps going.

At / near the bottom it says:

ld: symbol(s) not found
collect2: ld returned 1 exit status

What am I doing wrong?

+3  A: 

Did you specify those paths? Looking at them, they're all pointing at: /Developer/Platforms/iPhoneSimulator.platform/... which explains why you're receiving the file is not of required architecture error; it's expecting device libraries and its finding simulator libraries.

Malaxeur
I suppose I did, but I'm not sure how, nor am I sure how to fix it.I'm really new at all this - Mac, objective-c, iPhone, you name it.Suggestions?
Dale
Note, the only thing I can remember specifying a path for was when I tried to import the MessageUI framework and to import it, I did "maneuver" to the folder you mentioned. I couldn't figure any other way to import that framework though as it wasn't in the list of existing frameworks when I went to add it, so I clicked on the other... button and browsed until I found it - in the 3.1 simulator folder.
Dale
Ah that's why. For some reason, the MessageUI framework doesn't show up as an existing framework. To add it to your project, open up your target information. (You can do this by selecting your build target, and right-clicking to select Get Info). On the 'General' tab, you'll see 'LInked Libraries'. Here you can add new libraries that are actually available. MessageUI.framework is indeed one of those libraries. This should solve your cross-platform build issues.
Malaxeur
Cool. Thank you very much.
Dale
+4  A: 

Solution wich helped me:

Right click on target -> Get Info -> "Build" tab -> Setting with name: Framework search paths add value "$(SDKROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks" and move it to the top of paths list

maintainer
This helped me! My problem was trying to run on the simulator, rather than the device. Putting this in solved both issues.
Eli
A: 

soloviev.mp

your solution is awsome!!! thanks a lot

Kam