build
build copied to clipboard
Building static or shared boost libraries with Emscripten
Trying to build boost libraries with following commands
cd boost_1_68_0
./bootstrap.sh
./b2 toolset=emscripten link=static variant=release threading=single runtime-link=static system random date_time
However it produces .bc files to me, not .a for static build flags or .so for shared build flags. Then I have problem linking that libraries into my WebAssebly project. How to produce .a or .so files here? Thanks!
Solved for now by running
# emar q library_name.a *.bc
for every .bc file in a directory.
Thank you for your contributions. Main development of B2 has moved to https://github.com/bfgroup/b2 This issue has been automatically marked as "transition" to indicate the potential for needing transition to the new B2 development project.
Thanks for your contribution @akontsevich, but I still encounter issues with building my CMake project. When I attempt to make my project I get the following error:
em++: error: /usr/local/boost_emscripten/lib/libboost_system.a: Unknown format, not a static library!
Have you encountered this?
I am stuck on this problem, please help: https://github.com/emscripten-core/emscripten/issues/17187
OP in that issue had
E:\emsdk\python\3.9.2-nuget_64bit\python.exe: can't open file 'E:\boost\boost_1_78_0\emcc.py': [Errno 2] No such file or directory
This line implies that emscripten toolset was not configured properly. So you have to be more specific,provide the build output, add your Boost/b2 config and so on.
https://github.com/bfgroup/b2/issues/170 https://github.com/bfgroup/b2/pull/111