I'm trying to create a static library in xcode 4.2.
I'm following the steps in this tutorial. However, I get the following error:
Ld /Users/harishk/Library/Developer/Xcode/DerivedData/Testlib-ailufzhcoulmzrflyhfgbwqbiksx/Build/Products/Debug-iphonesimulator/Testlib.app/Testlib normal i386
cd /Users/harishk/Desktop/sl/Testlib
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/clang -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/harishk/Library/Developer/Xcode/DerivedData/Testlib-ailufzhcoulmzrflyhfgbwqbiksx/Build/Products/Debug-iphonesimulator -L/Users/harishk/Desktop/sl/Testlib/Testlib/lib -L/Users/harishk/Desktop/sl/Testlib/../lib -L/Users/harishk/Desktop/sl/Testlib -F/Users/harishk/Library/Developer/Xcode/DerivedData/Testlib-ailufzhcoulmzrflyhfgbwqbiksx/Build/Products/Debug-iphonesimulator -filelist /Users/harishk/Library/Developer/Xcode/DerivedData/Testlib-ailufzhcoulmzrflyhfgbwqbiksx/Build/Intermediates/Testlib.build/Debug-iphonesimulator/Testlib.build/Objects-normal/i386/Testlib.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -objC -all_load -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework UIKit -framework Foundation -framework CoreGraphics -lSimpleLibrary -o /Users/harishk/Library/Developer/Xcode/DerivedData/Testlib-ailufzhcoulmzrflyhfgbwqbiksx/Build/Products/Debug-iphonesimulator/Testlib.app/Testlib
ld: warning: ignoring file /Users/harishk/Desktop/sl/lib/libSimpleLibrary.a, file was built for archive which is not the architecture being linked (i386)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_MathFunctions", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The MathFunctions class is missing. Either from your application project or from the SimpleLibrary.a that you use. Make sure it is part of the compilation and linking steps of your build.
Related
Ld /Users/rajeshmedampudi/Library/Developer/Xcode/DerivedData/sampleResource-flngddqnaawregcrrshzpianssjc/Build/Products/Debug-iphonesimulator/sampleResource.app/sampleResource normal i386
cd /Users/rajeshmedampudi/Dropbox/Work/iphone/sampleResource
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -L/Users/rajeshmedampudi/Library/Developer/Xcode/DerivedData/sampleResource-flngddqnaawregcrrshzpianssjc/Build/Products/Debug-iphonesimulator -F/Users/rajeshmedampudi/Library/Developer/Xcode/DerivedData/sampleResource-flngddqnaawregcrrshzpianssjc/Build/Products/Debug-iphonesimulator -filelist /Users/rajeshmedampudi/Library/Developer/Xcode/DerivedData/sampleResource-flngddqnaawregcrrshzpianssjc/Build/Intermediates/sampleResource.build/Debug-iphonesimulator/sampleResource.build/Objects-normal/i386/sampleResource.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/rajeshmedampudi/Library/Developer/Xcode/DerivedData/sampleResource-flngddqnaawregcrrshzpianssjc/Build/Products/Debug-iphonesimulator/sampleResource.app/sampleResource
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_User", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_AuthenticationViewController", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_AppHelpers", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
this is the error I am getting when I try to run the file ... I have imported those classes from another project into this one which was non arc based and converted to ARC. I got this error after successfully removing all the references to autorelease and retains from it.
Did you try Product->Clean?
Or restarting XCode?
Did you make sure you've included everything in the Targets->Build Phases->Compile Sources? Xcode does this for you, but sometimes it misses things.
I tried to use this code but it doesn't work. http://developer.apple.com/library/ios/#samplecode/PageControl/Introduction/Intro.html
Ld "/Users/waitonza/Library/Developer/Xcode/DerivedData/Dr_Ngoo-aanknxmuodcgjicaigxevljxokeq/Build/Products/Debug-iphonesimulator/Dr
Ngoo.app/Dr Ngoo" normal i386
cd /Users/waitonza/Desktop/Project/Dr-Ngoo
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk
-L/Users/waitonza/Library/Developer/Xcode/DerivedData/Dr_Ngoo-aanknxmuodcgjicaigxevljxokeq/Build/Products/Debug-iphonesimulator
-F/Users/waitonza/Library/Developer/Xcode/DerivedData/Dr_Ngoo-aanknxmuodcgjicaigxevljxokeq/Build/Products/Debug-iphonesimulator
-filelist "/Users/waitonza/Library/Developer/Xcode/DerivedData/Dr_Ngoo-aanknxmuodcgjicaigxevljxokeq/Build/Intermediates/Dr
Ngoo.build/Debug-iphonesimulator/Dr Ngoo.build/Objects-normal/i386/Dr
Ngoo.LinkFileList" -mmacosx-version-min=10.6 -Xlinker
-objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -framework QuartzCore -framework SystemConfiguration -lsqlite3.0 -framework UIKit -framework Foundation -framework CoreGraphics -o
"/Users/waitonza/Library/Developer/Xcode/DerivedData/Dr_Ngoo-aanknxmuodcgjicaigxevljxokeq/Build/Products/Debug-iphonesimulator/Dr
Ngoo.app/Dr Ngoo"
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_PagingScrollViewController", referenced from:
objc-class-ref in DrNgooAppDelegate.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit
code 1 (use -v to see invocation)
The solution is the same as we've discussed in the comments:
I checked your project and it does not have PagingScrollViewController. You're probably referencing it from outside the folder. Add it to the project too and it should work fine!
#CodaFi also had the correct answer so +1 to him too!
The class PagingScrollViewController is not in your compile list. In the file tree, click your project at the top, then go to your target>build phases expand 'compile phase', then drag the PagingScrollViewController.m file to the list and run.
I'm trying to make an app that uses Protocol Buffers. I'm getting this error, any idea why?
Ld /Users/fmota/Library/Developer/Xcode/DerivedData/PBTest-gvudadeakgzklbekugyiqyfyprlt/Build/Products/Debug-iphonesimulator/PBTest.app/PBTest normal i386
cd /Users/fmota/Documents/Developer/Protobuf/PBTest
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/clang -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/fmota/Library/Developer/Xcode/DerivedData/PBTest-gvudadeakgzklbekugyiqyfyprlt/Build/Products/Debug-iphonesimulator -F/Users/fmota/Library/Developer/Xcode/DerivedData/PBTest-gvudadeakgzklbekugyiqyfyprlt/Build/Products/Debug-iphonesimulator -filelist /Users/fmota/Library/Developer/Xcode/DerivedData/PBTest-gvudadeakgzklbekugyiqyfyprlt/Build/Intermediates/PBTest.build/Debug-iphonesimulator/PBTest.build/Objects-normal/i386/PBTest.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework SystemConfiguration -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/fmota/Library/Developer/Xcode/DerivedData/PBTest-gvudadeakgzklbekugyiqyfyprlt/Build/Products/Debug-iphonesimulator/PBTest.app/PBTest
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_AreaRequest_Builder", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Yes, this is a common problem I've seen.
Check out the answer to this nearly duplicate question and let me know if it solves the issue for you. :-)
Add *.pb.h and *.pb.m to "TARGET"->"Build Phases"->"Compile Sources"!
My working env is xcode 5.0.2.
Add *.pb.m to "TARGET"->"Build Phases"->"Compile Sources"
Do NOT add *.pb.h, after I added *.pb.h, it cannot link.
I am getting this error, don't know what is the solution to it
Ld /Users/Omer/Library/Developer/Xcode/DerivedData/LoginTest-eibsbylnvmiovwhavrqixbxjpvbm/Build/Products/Debug-iphonesimulator/LoginTest.app/LoginTest normal i386
cd /Users/Omer/Documents/development/LoginTest
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/clang -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/Omer/Library/Developer/Xcode/DerivedData/LoginTest-eibsbylnvmiovwhavrqixbxjpvbm/Build/Products/Debug-iphonesimulator -F/Users/Omer/Library/Developer/Xcode/DerivedData/LoginTest-eibsbylnvmiovwhavrqixbxjpvbm/Build/Products/Debug-iphonesimulator -filelist /Users/Omer/Library/Developer/Xcode/DerivedData/LoginTest-eibsbylnvmiovwhavrqixbxjpvbm/Build/Intermediates/LoginTest.build/Debug-iphonesimulator/LoginTest.build/Objects-normal/i386/LoginTest.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -lz -framework CoreGraphics -framework Foundation -framework CFNetwork -framework SystemConfiguration -framework MobileCoreServices -framework UIKit -o /Users/Omer/Library/Developer/Xcode/DerivedData/LoginTest-eibsbylnvmiovwhavrqixbxjpvbm/Build/Products/Debug-iphonesimulator/LoginTest.app/LoginTest
Undefined symbols for architecture i386:
"_GHAssertTrue", referenced from:
-[VektorViewController testAuthentication] in VektorViewController.o
"_GHAssertNil", referenced from:
-[VektorViewController testAuthentication] in VektorViewController.o
"_GHAssertFalse", referenced from:
-[VektorViewController testAuthentication] in VektorViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
If you are trying to build a project and not run unit tests then you need to remove the test cases from your main project. If your are building the test project then you will need to include the GHUnit project.
Can any one tell me the meaning of this error ,
this is the details of the error log :
Ld build/Debug-iphonesimulator/Holiday.app/Holiday normal i386
cd /Users/Ahmed/Desktop/klazuka-Kal-b2e164c/Examples/Holiday
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/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk -L/Users/Ahmed/Desktop/klazuka-Kal-b2e164c/Examples/Holiday/build/Debug-iphonesimulator -F/Users/Ahmed/Desktop/klazuka-Kal-b2e164c/Examples/Holiday/build/Debug-iphonesimulator -filelist /Users/Ahmed/Desktop/klazuka-Kal-b2e164c/Examples/Holiday/build/Holiday.build/Debug-iphonesimulator/Holiday.build/Objects-normal/i386/Holiday.LinkFileList -mmacosx-version-min=10.6 -all_load -Xlinker -objc_abi_version -Xlinker 2 -framework Foundation -framework UIKit -framework CoreGraphics /Users/Ahmed/Desktop/klazuka-Kal-b2e164c/src/build/Debug-iphoneos/libKal.a -lsqlite3 -o /Users/Ahmed/Desktop/klazuka-Kal-b2e164c/Examples/Holiday/build/Debug-iphonesimulator/Holiday.app/Holiday
ld: warning: in /Users/Ahmed/Desktop/klazuka-Kal-b2e164c/src/build/Debug-iphoneos/libKal.a, missing required architecture i386 in file
Undefined symbols:
"_OBJC_CLASS_$_KalViewController", referenced from:
objc-class-ref-to-KalViewController in HolidayAppDelegate.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
It's a linker error, ensure that KalViewController is added to the current target, choose Get Info on it and go to the targets tab, ensure that the box is ticked.
In the Kal project's settings, make sure that it is compiled for the i386 architecture.