简体   繁体   English

如何从多个cpp文件编译WebAssembly?

[英]How to compile WebAssembly from multiple cpp files?

I'm using emscripten to compile c++ to WASM, but can only do this for one file at a time. 我正在使用emscripten将c ++编译为WASM,但一次只能对一个文件执行此操作。 I don't want to put my entire project and libraries in one file, but I haven't found any information on how to properly compile it. 我不想将整个项目和库放在一个文件中,但是我没有找到有关如何正确编译它的任何信息。

Just put all source files in the emcc command line like this: 只需将所有源文件放在emcc命令行中,如下所示:

emcc src1.cpp src2.cpp src3.cpp

See reference here: https://kripken.github.io/emscripten-site/docs/tools_reference/emcc.html 请参阅此处的参考: https : //kripken.github.io/emscripten-site/docs/tools_reference/emcc.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM