Error in xcode project: ld: library not found for -lcrt1.10.6.o

后端 未结 12 1061
日久生厌
日久生厌 2020-12-05 07:09

Just upgraded to Snow Leopard, installed Xcode 3.2, then installed iPhone SDK 3 for SL.

In a project, I now get the following error on build:

相关标签:
12条回答
  • 2020-12-05 07:39
    Add the following to ~/.profile (for Mac OS X 10.5):
    
    export C_INCLUDE_PATH=/Developer/SDKs/MacOSX10.5.sdk/usr/include
    
    export LIBRARY_PATH=/Developer/SDKs/MacOSX10.5.sdk/usr/lib
    

    Given Kirandan's limited scenario (Snow Leopard, Xcode 3.2.1, iphone, library path error), Stefan's answer (above) worked for me, except my exception was with 10.5 (-lcrt1.10.5.o).

    Elsewhere, I'd seen an answer by Gabor Cselle (author of reMail), and he fixed this specific issue by using a symbolic link (someone referenced this page, by the way), but he noted this was not the best way.

    0 讨论(0)
  • 2020-12-05 07:44

    I had the same issue in a Fortran Makefile. Added the following option after the compiler (For OSX 10.5):

    -L/Developer/SDKs/MacOSX10.5.sdk/usr/lib

    e.g.,

    g77 -L/Developer/SDKs/MacOSX10.5.sdk/usr/lib

    Now the compiler will find the library you want !

    0 讨论(0)
  • 2020-12-05 07:45

    Wasted few hours on this one...

    Interestingly, for me the problem was only for Simulator-Debug. It wasnt complaining for Simulator-Release or Device Debug/Release!

    anyway, Changing Deployment Target to 10.5 solved this for me!!

    0 讨论(0)
  • 2020-12-05 07:45

    I had this problem when I was using Xcode 4 on one machine and Xcode 3.2.6 on another. The two versions are supposed to be able to swap .xcodeproj files between them but I found that in the project.pbxproj file (inside the .xcodeproj directory), there were still a couple of places that read:

    MACOSX_DEPLOYMENT_TARGET = 10.6;

    I quit Xcode and went and changed the three occurrences to:

    MACOSX_DEPLOYMENT_TARGET = 10.5;

    After reopening the project, I could build again. Whew!

    0 讨论(0)
  • 2020-12-05 07:49

    Add the following to ~/.profile (for Mac OS X 10.5):

    export C_INCLUDE_PATH=/Developer/SDKs/MacOSX10.5.sdk/usr/include
    export LIBRARY_PATH=/Developer/SDKs/MacOSX10.5.sdk/usr/lib
    
    0 讨论(0)
  • 2020-12-05 07:52

    Edit Project Settings -> In the build tab -> For Mac OS X Deployment Target, change it to 10.5 for XCode 3 (not 10.6 even if on 10.6) and see if that helps.

    For XCode 4, you'll need to set it to 10.6

    P.S. Make sure you set that for all targets, not just release or debug. (if you didn't, one would fail, the other wouldn't)

    0 讨论(0)
提交回复
热议问题