B Programmer
B Programmer

Reputation: 51

Is it possible to compile a WebAssembly using '.lib' files?

I am wondering if is possible to do so. I know this is possibly a noob question, if it is, I apologise. In the documentation seems to not be clearly stated.

Let's say I have my test.cpp file which has references to a third party library, that I have already compiled in a .lib file.

would be possible to compile my cpp file passing to the emcc compiler the lib file for the references, instead of all cpp files of that library?

I have tried with some attempts, but I get errors like the following 'undefined symbol: Library::Class::method()' when building. I don't get errors if I try to build a .bc file but the final size of the output file is way smaller compared to the one built using all cpp files (seems is not including anything from .lib files).

an example of What I tried:

emcc test.cpp -L path/to/lib1.lib -L path/to/lib2.lib

Upvotes: 0

Views: 70

Answers (0)

Related Questions