问题
I am trying to compile a Xcode project which was a Xcode 3.2 project with Xcode 4. I am getting the following error.
ld: file not found: -Xlinker collect2: ld returned 1 exit status Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
Unable to figure out the issue.
And this happens only when I use the Gcc4.2 compiler. When I use LLVM it works fine.
回答1:
According to http://www.cocoadev.com/index.pl?ApplicationLinkingIssues you might have framework references to old locations that do not exist anymore. Check the library list in MyProject.xcodeproj / Targets / Build Phases / Link Binary with Libraries, maybe they have to be removed and added again. Do a Product / Clean because XCode often does not realise changes in the build settings.
来源:https://stackoverflow.com/questions/7087478/linking-failing-with-xlinker-file-not-found-error