我正尝试用emscripten把我的一个项目移植到web上,我在其中使用的一个库是soloud,构建库本身编译得很好,没有错误,但是当我尝试用它编译一个例子时,我得到了一堆编译器错误。
下面是我构建库所使用的步骤:
1.下载并构建genie
1.下载soloud并将genie
可执行文件放入构建文件夹
1.运行./genie --with-miniaudio-only gmake
1.将cd
复制到gmake
目录并运行emmake make
这可以很好地编译,没有任何错误,但是当我尝试使用emcc main.cpp libsoloud_static.a -I ../include -o index.html
构建simplest
示例时,我得到了这些错误
emcc: warning: libsoloud_static.a: archive is missing an index; Use emar when creating libraries to ensure an index is created [-Wemcc]
emcc: warning: libsoloud_static.a: adding index [-Wemcc]
error: undefined symbol: _ZN6SoLoud6Soloud19getActiveVoiceCountEv (referenced by top-level compiled C/C++ code)
warning: Link with `-sLLD_REPORT_UNDEFINED` to get more information on undefined symbols
warning: To disable errors for undefined symbols use `-sERROR_ON_UNDEFINED_SYMBOLS=0`
warning: __ZN6SoLoud6Soloud19getActiveVoiceCountEv may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: _ZN6SoLoud6Soloud4initEjjjjj (referenced by top-level compiled C/C++ code)
warning: __ZN6SoLoud6Soloud4initEjjjjj may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: _ZN6SoLoud6Soloud4playERNS_11AudioSourceEffbj (referenced by top-level compiled C/C++ code)
warning: __ZN6SoLoud6Soloud4playERNS_11AudioSourceEffbj may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: _ZN6SoLoud6Soloud6deinitEv (referenced by top-level compiled C/C++ code)
warning: __ZN6SoLoud6Soloud6deinitEv may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: _ZN6SoLoud6SoloudC1Ev (referenced by top-level compiled C/C++ code)
warning: __ZN6SoLoud6SoloudC1Ev may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: _ZN6SoLoud6SoloudD1Ev (referenced by top-level compiled C/C++ code)
warning: __ZN6SoLoud6SoloudD1Ev may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: _ZN6SoLoud6Speech7setTextEPKc (referenced by top-level compiled C/C++ code)
warning: __ZN6SoLoud6Speech7setTextEPKc may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: _ZN6SoLoud6SpeechC1Ev (referenced by top-level compiled C/C++ code)
warning: __ZN6SoLoud6SpeechC1Ev may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: _ZN6SoLoud6SpeechD1Ev (referenced by top-level compiled C/C++ code)
warning: __ZN6SoLoud6SpeechD1Ev may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: _ZN6SoLoud6Thread5sleepEi (referenced by top-level compiled C/C++ code)
warning: __ZN6SoLoud6Thread5sleepEi may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
Error: Aborting compilation due to previous errors
我哪里做错了?
1条答案
按热度按时间zwghvu4y1#
更新:
我可以通过改变这个来让它工作
到这个
还有这个
到这个
(仍然不确定为什么我必须删除
-msse4.1
标志,但我得到了一个奇怪的错误)由于某种原因,它仍然使用常规编译器而不是emscripten。