emscripten-core / emsdk

Emscripten SDK
http://emscripten.org
Other
2.92k stars 660 forks source link

errors while running emmake make #1381

Closed SoftwareMechanic closed 1 month ago

SoftwareMechanic commented 1 month ago

Hello everyone, I am trying to compile a library, but after running emcmake cmake and the emmake make I faced the following error:

/usr/include/stdint.h:26:10: fatal error: 'bits/libc-header-start.h' file not found
#include <bits/libc-header-start.h>

so, as a suggestion found on the web I installed gcc-multilib running: sudo apt-get install gcc-multilib. now re-running emmake make I am facing a lot of errors, I show some for reference:

/home/bm/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/complex:1093:18: error: no template named '__promote'
complex<typename __promote<_Tp, _Up>::type>
                 ^

/home/bm/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/complex:1096:30: error: no template named '__promote'
    typedef complex<typename __promote<_Tp, _Up>::type> result_type;
                             ^

/home/bm/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__bsd_locale_fallbacks.h:114:5: error: use of undeclared identifier 'va_start'
    va_start(__va, __format);
    ^

/home/bm/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__bsd_locale_fallbacks.h:117:5: error: use of undeclared identifier 'va_end'
    va_end(__va);
    ^

/home/bm/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__support/musl/xlocale.h:47:8: error: cannot add 'abi_tag' attribute in a redeclaration
inline _LIBCPP_HIDE_FROM_ABI long double
       ^

/usr/include/boost/math/special_functions/sign.hpp:30:22: error: reference to unresolved using declaration
        return (std::signbit)(x) ? 1 : 0;
                     ^

and at this point I don't know where to look for.

Please keep in mind I am new to EMSCRIPTEN and WebAssembly, bear with me.

did you face something similar? what would be your approach?

SoftwareMechanic commented 1 month ago

I foind out that the compilation was including even /usr/include folder, I replaced-I /usr/include with -sUSE_BOOST_HEADERS=1 and it works!