我正在尝试将现有项目移植到需要Boost.Thread库的iPhone,项目编译时没有错误,但是存在链接错误:
"boost::thread::start_thread()",referenced from: boost::thread::thread<(anonymous namespace)::ReadThread::Function>((anonymous namespace)::ReadThread::Function,boost::disable_if<boost::is_convertible<(anonymous namespace)::ReadThread::Function&,boost::detail::thread_move_t<(anonymous namespace)::ReadThread::Function> >,boost::thread::dummy*>::type)in ChessEngine.o
如何将所需的线程库添加到Xcode项目?
附: boost lib位于:/usr/local/lib/libboost_thread-mt.a
编辑(找到库,但出现架构错误):
在Linking to Boost.Signals using Xcode之后,在库搜索路径中添加/usr/local/lib并在其他链接器标志中添加-lboost_thread-mt后,找到该库.但是,有新的错误和警告:
ld: warning: in /usr/local/lib/libboost_thread-mt.dylib,file was built for unsupported file format which is not the architecture being linked (i386)
如何让lib工作在iOS(4.0或更高版本)?谢谢!