Hello, I am trying to import a c++ project that contains 2 cpp files, 2 header files, and two dependency libraries, namely Eigen and igl. The code compiles and runs fine through emcc, however when I pack it into a .a library through emcc and emar and import into unity, this error pops up. Can anyone give me some possible idea on where to look? Thanks
Library\Bee\artifacts\WebGL\build\debug_WebGL_wasm\build.js: undefined symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE25__init_copy_ctor_externalEPKcm (referenced by top-level compiled C/C++ code)
I have previously looked into this and instead used .a static libraries, and I have successfully imported with this method simple hello functions in unity. It is with a specific build that I have failed.
I’m surprised that worked at all but maybe static libraries are somewhat different, since they are static, the IL2CPP linker may simply integrate them.
However, have you tested this to work across platforms in the browser? If you build a C++ static library, same as with DLLs, the compiled code will be for a specific platform such as Windows, OS X, Linux, Android, iOS, etc. and that code will fail to work on most other platforms.
when I attempt to use the assignment std::vector<std::string> vec2 = vec1_ref;
where vec2 is a vector of strings, and vec1_ref is a reference to a vector of strings passed by reference from function parameters. Either of these two will cause this error in compilation, but I can’t seem to find a fix. Can anyone offer some insights?