faithfracture / Apple-Boost-BuildScript

Script for building Boost for Apple platforms (iOS, iOS Simulator, tvOS, tvOS Simulator, OS X)
279 stars 111 forks source link

build but use error #38

Closed backhat-backhat closed 5 years ago

backhat-backhat commented 5 years ago

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?

backhat-backhat commented 5 years ago

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:

faithfracture commented 5 years ago

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")

backhat-backhat commented 5 years ago

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?

faithfracture commented 5 years ago

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.

faithfracture commented 5 years ago

Closing due to inactivity.