如何清除对Mix_MusicInterface_MPG123的未定义引用?

时间:2019-06-11 18:52:56

标签: compilation linker sdl libraries

我正在尝试配置和制作sdl混合器库,但出现错误

build/.libs/libSDL2_mixer.so: undefined reference to `Mix_MusicInterface_MPG123'
build/.libs/libSDL2_mixer.so: undefined reference to `Mix_MusicInterface_Opus'
build/.libs/libSDL2_mixer.so: undefined reference to `Mix_MusicInterface_MODPLUG'
我相信这些库已安装。但是它们应该是动态链接的,这可能是我没有正确执行操作的原因。我相信MPG123可以处理.mp3文件格式,这解释了为什么我无法在运行时加载mp3。

我的SDL2_mixer-2.0.4库中构建文件中$ .. / config命令的

输出。显示此内容,您可以看到这3个库都可用且可用。

checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... yes
checking for windres... no
checking for linux-gnu-windres... no
checking for an ANSI C-conforming const... yes
checking for GCC -MMD -MT option... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for SDL... yes
checking for pow in -lm... yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking for setbuf... yes
checking for GCC -fvisibility=hidden option... yes
checking for fork... yes
checking for vfork... yes
checking for MODPLUG... yes
-- dynamic libmodplug -> libmodplug.so.1
checking fluidsynth.h usability... yes
checking fluidsynth.h presence... yes
checking for fluidsynth.h... yes
checking for fluid_player_add_mem in -lfluidsynth... yes
-- dynamic libfluidsynth -> libfluidsynth.so.1
checking vorbis/vorbisfile.h usability... yes
checking vorbis/vorbisfile.h presence... yes
checking for vorbis/vorbisfile.h... yes
checking for ov_open_callbacks in -lvorbisfile... yes
-- dynamic libvorbisfile -> libvorbisfile.so.3
checking FLAC/export.h usability... yes
checking FLAC/export.h presence... yes
checking for FLAC/export.h... yes
checking for libflac so-name version >= 8... yes
checking FLAC/stream_decoder.h usability... yes
checking FLAC/stream_decoder.h presence... yes
checking for FLAC/stream_decoder.h... yes
checking for FLAC__stream_decoder_new in -lFLAC... yes
-- dynamic libFLAC -> libFLAC.so.8
checking mpg123.h usability... yes
checking mpg123.h presence... yes
checking for mpg123.h... yes
checking for mpg123_replace_reader_handle in -lmpg123... yes
-- dynamic libmpg123 -> libmpg123.so.0
checking for OPUSFILE... yes
-- dynamic opusfile -> libopusfile.so.0
configure: creating ./config.status
config.status: executing libtool commands
configure: creating ./config.status
config.status: creating Makefile
config.status: creating SDL2_mixer.spec
config.status: creating SDL2_mixer.pc
config.status: executing libtool commands
config.status: executing default commands

我希望没有错误消息,因为它通过了配置清单,而在此之前我还没有安装它们,并且modplug,mpg123和opus的输出为“ no”。但是我从来没有真正做到过这一点,而且我知道通常不仅仅可以看到。所以请赐教。

1 个答案:

答案 0 :(得分:0)

好吧,在我的sdl混合器生成文件中,还有另一个带有复制副本的生成文件,花了我很长时间才意识到这很可能是我没有注意到的。这似乎是问题所在,将其删除并构建。