新版xcode编译问题xcode4.3以上
公司用的boost是1.46.1的.要在ios上使用.
按照http://paulsolt.com/2010/04/c-logging-and-building-boost-for-iphoneipad-3-2-and-macosx/这个文章做的.目前只测试了,thread,在ios真机上是可以运行的.
下面我把我的编译设置写出来.
我的系统是lion 10.7.2 xcode4.1 和xcode4.2beta.由于ios真机是ios5.0的系统,所以我用的4.2测试的.
~/user-config.jam
using darwin : 4.2.1~iphone
: /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv7 -mthumb -fvisibility=hidden -fvisibility-inlines-hidden
: <striper>
: <architecture>arm <target-os>iphone
;
using darwin : 4.2.1~iphonesim
: /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -fvisibility=hidden -fvisibility-inlines-hidden
: <striper>
: <architecture>x86 <target-os>iphone
tools/build/v2/tools/darwin.jam
.macosx-versions =
10.7 10.6
iphone-4.3 iphonesim-4.3
iphone-4.0 iphonesim-4.0
;
静态编译
./bootstrap.sh
./bjam --prefix=/iphonetest/ toolset=darwin architecture=arm target-os=iphone macosx-version=iphone-4.3 define=_LITTLE_ENDIAN link=static install
在编译真机的静态库时,我这出现5个.a文件无法通过.看错误是因为stl的问题.我没有涉及到那个库的调用,所以就不理会它.
模拟器的我还没有尝试.主要测试真机的.如果真机都不可以.模拟器能用也没意义.
编译注意事项:
1.如果你修改了*.jam文件.在执行./bjam前,必须重新执行./bootstrap.sh
2.macosx-version=iphone-4.3 是当前系统下/Developer/Platforms/iPhoneOS.platform/Developer/SDKs和/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs下的ios系统版本.我尝试过4.0,结果告知失败.
调试注意事项:
在调试的时候会报 bad codegen.pointer diff错误.
只需要在工程的build settings设置symbles Hidden by default为yes.系统默认debug模式时,其值为no.
ps:为了防止那个链接出现问题.特意把网页上传.下载后只需要把png后缀改为html即可.