Linking Error in Xcode

前端 未结 12 1097
予麋鹿
予麋鹿 2021-01-11 11:40

I am getting this error after adding the libxml2.2.dylib file

 Linking /Users/Biranchi/Desktop/Funmovies TabBarController/build/Debug-iphonesimulator/funmovi         


        
相关标签:
12条回答
  • 2021-01-11 12:34

    I had to remove this library libz.1.2.3.dylib and add this one libz.1.2.5.dylib. After that it compiled fine.

    0 讨论(0)
  • 2021-01-11 12:35

    To add to Graham Heath's answer - which I think deserves more prominence in the thread.

    Checking for a missing framework is the quickest and easiest fix to try. Totally non-destructive and probably the cause of these sort of errors for most people. Just browse the list of frameworks for something that looks appropriate and try it. I think many people are fooled because XCode does not flag a problem with a class when you write the code - just when you link it.

    My error was: "linker command failed with exit code 1 (use -v to see invocation)" concerning a couple of errors in CoreLocation:

    "Undefined symbols for architecture armv7: "_OBJC_CLASS_$_CLLocationManager", referenced from: objc-class-ref in NPTViewController.o"

    I added CoreLocation.framework and the job was done.

    0 讨论(0)
  • 2021-01-11 12:37

    Try to issue the failed command from the command line. There, you will see the stderr output that is not shown via GUI.

    0 讨论(0)
  • 2021-01-11 12:38

    Got the same error, now even when I`ve deleted libxml2 from project error still here :) This sh**y XCode wrote this:

    LIBRARY_SEARCH_PATHS = (
    +                    "$(inherited)",
    +                    /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib,
    +                );
    

    into project`s config file "project.pbxproj" in "MyProj.xcodeproj".

    You can change this path by hands to something like:

    LIBRARY_SEARCH_PATHS = (
    +                    "$(inherited)",
    +                    /Developer/Platforms/iPhoneSimulatorOS.platform/Developer/SDKs/iPhoneSimulatorOS3.0.sdk/usr/lib,
    +                );
    

    But do not forget to change it back when compile into device. I`ll try to find more simple way to resolve this problem.

    0 讨论(0)
  • 2021-01-11 12:39

    Make sure you import with correct extension.

    I got the error when I by mistake wrote #import "AClass.m" instead of #import "AClass.h" :-)

    0 讨论(0)
  • 2021-01-11 12:39

    If this is a problem related to a specific frame work, make sure it is enabled in the build phase. For me I had to add MessageUI.framework: In Xcode 4 goto the build phases tab for your target. Make sure you see the frameworks you are using. If it's not there click + to add it.

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