在IOS 5.0 中使用BOOST C++库

我使用的是boost_1_47_0

使用终端

tar xzf boost_1_47_0.tar.gz
cd boost_1_47_0
./bootstrap.sh

# Set this to whatever you want to build against
SDK_VERSION="5.0"

# Install for device:
./bjam --prefix=${HOME}/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDK_VERSION}.sdk/usr toolset=darwin architecture=arm target-os=iphone macosx-version=iphone-${SDK_VERSION} define=_LITTLE_ENDIAN link=static install

# Install for simulator
./bjam --prefix=${HOME}/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator${SDK_VERSION}.sdk/usr toolset=darwin architecture=x86 target-os=iphone macosx-version=iphonesim-${SDK_VERSION} link=static install

 

在编译结束后,如果你编译的结果不在HD/Developer/下而是在user/Developer下,只需将User/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr 下include和lib里的文件拷贝到HD/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr  

将User/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr 下include和lib里的文件拷贝到HD/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr 

在新建的XCODE 工程中类似添加原生库的方法添加所有BOOST库编译.a文件,就可以使用BOOST c++了。

 已经编译好的库下载链接:http://dl.dbank.com/c0i99xair7

 

posted @ 2011-11-16 17:59  曙光中睡懒觉  阅读(1968)  评论(0)    收藏  举报