Hi, I'm a newbie to iOS programming. Using xcode 4.0.2. I created an iPhone static library project and built a test library libTest.a. Then in a separate iPhone application project, I tried to link with the static library and got the error:
In the build settings, both library and application projects are targeting iphonesimulator, iphoneos in the supported platforms, and the Standard (armv6 armv7) architecture. Why does the xcode tried to link with i386 flag? Can somebody please let me know how this can be resolved?
Code:
Ld /Users/eccl224/Library/Developer/Xcode/DerivedData/Test_Hello-avzmwtnikzskcgdayrbfnffnhsxu/Build/Products/Debug-iphonesimulator/Test_Hello.app/Test_Hello normal i386
cd /Users/eccl224/Applications/Test_Hello
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/eccl224/Library/Developer/Xcode/DerivedData/Test_Hello-avzmwtnikzskcgdayrbfnffnhsxu/Build/Products/Debug-iphonesimulator -L../Test -L/Users/eccl224/Applications/Test_Hello/../Test -F/Users/eccl224/Library/Developer/Xcode/DerivedData/Test_Hello-avzmwtnikzskcgdayrbfnffnhsxu/Build/Products/Debug-iphonesimulator -filelist /Users/eccl224/Library/Developer/Xcode/DerivedData/Test_Hello-avzmwtnikzskcgdayrbfnffnhsxu/Build/Intermediates/Test_Hello.build/Debug-iphonesimulator/Test_Hello.build/Objects-normal/i386/Test_Hello.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -lTest -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/eccl224/Library/Developer/Xcode/DerivedData/Test_Hello-avzmwtnikzskcgdayrbfnffnhsxu/Build/Products/Debug-iphonesimulator/Test_Hello.app/Test_Hello
ld: warning: ignoring file ../Test/libTest.a, missing required architecture i386 in file
Undefined symbols for architecture i386:
"_new_MyTest", referenced from:
_myTest in Test_HelloAppDelegate.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
In the build settings, both library and application projects are targeting iphonesimulator, iphoneos in the supported platforms, and the Standard (armv6 armv7) architecture. Why does the xcode tried to link with i386 flag? Can somebody please let me know how this can be resolved?
Last edited: