经过很多hack,我成功地为iPhone编译了boost库,包括设备和仿真器。但是当我尝试使用它们时,Xcode调试器会报错:
dyld: Library not loaded: libboost_graph.so.1.40.0
我猜测这是一个动态库加载器,在iPhone上不被允许。我使用
-Lboost_graph
作为编译器标志链接应用程序。以下是我用于构建Boost的脚本:
./bjam $1 $2 $3 \
toolset=darwin \
architecture=arm \
target-os=iphone \
macosx-version=iphone-3.0 \
define=_LITTLE_ENDIAN \
--layout=system \
--libdir=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/lib \
--includedir=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/include \
link=static \
runtime-link=static
./bjam $1 $2 $3 \
toolset=darwin \
architecture=x86 \
target-os=iphone \
macosx-version=iphonesim-3.0 \
--layout=system \
--libdir=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/usr/lib \
--includedir=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/usr/include \
link=static \
runtime-link=static
我猜我可能错过了一些非常基础的东西,但是错过了什么呢?
这个库是否编译为动态加载(在平台/usr/lib中有一个.a文件和一个.so文件)?