faithfracture / Apple-Boost-BuildScript

Script for building Boost for Apple platforms (iOS, iOS Simulator, tvOS, tvOS Simulator, OS X)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

build but use error

backhat-backhat opened this issue · comments

when I build this project, and use arm64, libboost.a, then "Undefined symbols for architecture arm64", it is very strange, I use the others's boost, it is ok, why?
how to use the libboost.a?

Asio not inside?
Undefined symbols for architecture arm64:
"boost::asio::ip::address_v6::to_string(boost::system::error_code&) const", referenced from:
libtorrent::http_tracker_connection::start() in libtorrent.a(http_tracker_connection.o)
"boost::asio::ip::address_v6::address_v6(boost::asio::ip::address_v6&&)", referenced from:
libtorrent::tracker_request::tracker_request(libtorrent::tracker_request&&) in libtorrent.a(tracker_manager.o)
"boost::asio::detail::socket_ops::sync_recv(int, unsigned char, iovec*, unsigned long, int, bool, boost::system::error_code&)", referenced from:

You use it like every other static library, there's nothing special about it. Undefined symbols usually means the library isn't being linked to correctly, although it could also mean that libboost.a was indeed built for the wrong architecture.

What parameters are you passing to boost.sh? (e.g. ./boost.sh -ios --ios-archs "arm64")

it is ok now, the problem is very strange, I use the other static library (ex. libtorrent.a), it uses boost.Asio.
the Xcode project import libtorrent.a and libboost.a, it will produces linking error, ex. Undefined symbols for architecture arm64, but when I import libtorrent source code files and libboost.a,
then it is ok now, and I don't know why?

Did you solve your problem? It's not really clear to me from your last comment whether or not you did.

The issue with libtorrent.a requiring Boost.Asio & you linking both libtorrent.a and libboost.a could potentially be the order in which you are linking the libraries - order matters. If you have libtorrent.a before libboost.a then Boost.Asio won't be available to libtorrent.a when the linker runs. If your still having the problem, try making sure you link Boost before linking libtorrent.

Closing due to inactivity.