lost library when recompiling Obj-C project
When I recompiled an old Obj-C project (a Cocoa app), the linker couldn't find some common library modules, including sin() and sysctl(). This project had been working in the previous version of Xcode. I am now using Xcode 3.1.2 in OSX 10.5. The error message was:
Line Location Tool:0: collect2: ld returned 1 exit status
Line Location Tool:0: symbol(s) not found
Line Location Tool:0: _AmIBeingDebugged in MeterMileage.o
Line Location Tool:0: "_sysctl", referenced from:
Line Location Tool:0: -[AnimatedStar drawRect:] in AnimatedStar.o
Line Location Tool:0: "_sin", referenced from:
...
My current version of Xcode will link with the correct library for a new proj开发者_开发知识库ect using sin(), etc. How do I fix the project which started in an earlier Xcode to use the correct library? I saw the post about linking in FFTW, but sin() is not so unusual, is it?
I suppose I could create a new project, and copy my code, etc into it, but that seems a little clumsy. Is there a better way? There will probably be more projects that need updating.
Thanks, Gary
It's likely that the older project is trying to explicitly link against an older copy of the C standard library or runtime that doesn't exist on 10.5. Please post the linker invocation line, not just the error results; that should give us some clues.
精彩评论