建筑soloud的例子,铭文不工作



我正在尝试用emscripten将我的一个项目移植到web上,我在其中使用的一个库是soloud。构建库本身可以很好地编译,没有错误,但是当我试图用它编译一个示例时,我得到了一堆编译器错误。

下面是我用来构建库的步骤:
  1. 下载并构建genie
  2. 下载soloud并将genie可执行文件放入构建文件夹
  3. 运行./genie --with-miniaudio-only gmake
  4. 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

我做错了什么?

UPDATE:

我可以让它工作通过改变这个

CC  = gcc
CXX = g++
AR  = ar

CC  = emcc
CXX = em++
AR  = emar

ALL_CPPFLAGS       += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES)
ALL_ASMFLAGS       += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -g -msse4.1 -fPIC
ALL_CFLAGS         += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -g -msse4.1 -fPIC
ALL_CXXFLAGS       += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -g -fno-exceptions -fno-rtti -msse4.1 -fPIC
ALL_OBJCFLAGS      += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -g -msse4.1 -fPIC
ALL_OBJCPPFLAGS    += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -g -fno-exceptions -fno-rtti -msse4.1 -fPIC

ALL_CPPFLAGS       += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES)
ALL_ASMFLAGS       += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -g -fPIC
ALL_CFLAGS         += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -g -fPIC
ALL_CXXFLAGS       += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -g -fno-exceptions -fno-rtti -fPIC
ALL_OBJCFLAGS      += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -g -fPIC
ALL_OBJCPPFLAGS    += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -g -fno-exceptions -fno-rtti -fPIC

(仍然不确定为什么我必须删除-msse4.1标志,但我得到一个奇怪的错误)

inSoloudStatic.make。由于某些原因,它仍然使用常规编译器而不是emscripten。

最新更新