如何将boost线程库添加到iPhone项目?

前端之家收集整理的这篇文章主要介绍了如何将boost线程库添加到iPhone项目?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试将现有项目移植到需要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或更高版本)?谢谢!

解决方法

我做了一些搜索,发现 this downloadable script将构建一个多架构的iphone就绪版本的boost.另请查看 this blog post关于使用它的信息.

猜你在找的Xcode相关文章