5

This is a strange problem. My XCode version is 6.3.2. After I installed the command line tools, I could not compile any more. Any compilation that need to link with a dylib will cause the error like:

ld: building for iOS Simulator, but linking against dylib built for MacOSX file '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib/libm.dylib' for architecture x86_64

This happens when I use pip to install uwsgi and compile mongrel2 manually.

I have already export SDKROOT to /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk and xcrun --show-sdk-path is showing that. gcc --version shows:

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1
Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.3.0
Thread model: posix

I know that gcc is link to clang, and I have tried to add option -mmacosx-version-min=10.9 to the CFLAGS, but nothing fixed.

I want to change the SDK to MacOSX, not iOS Simulator, how can I do that? Or what can I do to fix this.

0

Browse other questions tagged or ask your own question.