******
修改main.soncs
mac_env.Replace(CC = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/i686-apple-darwin10-llvm-g++-4.2')
# Use my-gcc instead of the default compiler.
mac_env.Replace(CXX = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/i686-apple-darwin10-llvm-gcc-4.2')
# Use my-gcc instead of the default compiler.
**
mac_env.Replace(CC = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2')
# Use my-gcc instead of the default compiler.
mac_env.Replace(CXX = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-g++-4.2')
# Use my-gcc instead of the default compiler.
**
mac_env.Replace(CC = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2')
# Use my-gcc instead of the default compiler.
mac_env.Replace(CXX = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/llvm-g++-4.2')
# Use my-gcc instead of the default compiler.
**
mac_env.Replace(CC = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2')
# Use my-gcc instead of the default compiler.
mac_env.Replace(CXX = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-g++-4.2')
# Use my-gcc instead of the default compiler.
**
*************
修改main.scons的sdk
注意,这里是
'-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk',
而不是
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk
否则会出现以下错误:
________Compiling build/dbg/obj/third_party/expat-2.0.1/lib/xmlparse.o
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/usr/include/sys/_types.h:33,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/usr/include/_types.h:27,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/usr/include/string.h:61,
from third_party/expat-2.0.1/lib/xmlparse.c:6:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/usr/include/machine/_types.h:32:25: error: i386/_types.h: No such file or directory
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/usr/include/_types.h:27,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/usr/include/string.h:61,
from third_party/expat-2.0.1/lib/xmlparse.c:6:
***************
下面的问题或许会用得到
********
Q: change C language dialect to GNU89 to get rid of asm and inline issues
Xcode 4.2 had finally added support for C++0X:
-
In the project build settings screen, switch on "All" options.
-
In the "Build Options" section, set compiler to "Apple LLVM compiler 3.0".
-
Scroll down to "Apple LLVM Compiler 3.0 - Language" section and set "C++ Language Dialect" to "C++0X" and "C++ Standard Library" to "libc++".
The std::move(), move constructor and R-Value reference are known to work as expected, and I'm testing on the std::thread and std::atomic.
************
Error:
asm("bswap %0" : "=r" (v) : "0" (v));
implicit declaration of function asm is invalid in c99
fix: 修改c dialect 为 GUN89
*********
Error
ld: warning: directory not found for option '-L/ilibjingle/gtalk/libjingle-0.5/talk/build/dbg/lib /ilibjingle/gtalk/libjingle-0.5/talk/third_party/openssl-1.0.0 /ilibjingle/gtalk/libjingle-0.5/talk/third_party/openssl-1.0.0/lib'
ld: library not found for -lcrypto-iphone
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Fix:
build setting -> basic -> 搜索对应的目录关键字,将之改为正确的路径,这样子可以修复上面的warning。
****