How to add an additional stream library to an iPhone project?

I'm trying to transfer an existing project to an iPhone that needs the Boost.Thread library, the project compiles without errors, but there are link errors:

 "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 

How to add the necessary stream libraries to the Xcode project?

ps boost lib is located in: /usr/local/lib/libboost_thread-mt.a

EDIT (library found, but architecture error received):

After linking to Boost.Signals using Xcode , after adding /usr/local/lib to the Library Search Path and -lboost_thread-mt to Other Linker Flags , the library was found. However, new errors and warnings appear:

 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) 

How can I work with lib for iOS (4.0 or later)? Thanks!

+4
source share
2 answers

I did a few more searches and found this downloadable script that will build an architecture version with support for iphone multi-architecture. Also check out this blog post about using this.

+1
source

It looks like you are trying to link the library for architecture (armv6,7) when you probably have the current target audience as a device (i386 is a simulator). If this is correct, I would say that you downloaded the library created for the device. To run in the simulator, you need the library version created for your computer (I386).

The easiest way to process any external library is to create a static framework for armv6 / armv7 / i386. Then this is a piece of cake to use. If this is as much as it sounds, I would look for functionality elsewhere :-)

0
source

Source: https://habr.com/ru/post/1336924/


All Articles