[Solved]困扰已久的一个问题:marsyas在window下mingw编译器编译错误

CMakeFiles\marsyas.dir/objects.a(RtAudio.cpp.obj):RtAudio.cpp:(.text+0xb7d): undefined reference to `DirectSoundCaptureCreate@12'
CMakeFiles\marsyas.dir/objects.a(RtAudio.cpp.obj):RtAudio.cpp:(.text+0xbab): undefined reference to `DirectSoundCreate@12'
CMakeFiles\marsyas.dir/objects.a(RtAudio.cpp.obj):RtAudio.cpp:(.text+0x48b3): undefined reference to `DirectSoundEnumerateA@8'
CMakeFiles\marsyas.dir/objects.a(RtAudio.cpp.obj):RtAudio.cpp:(.text+0x48f5): undefined reference to `DirectSoundCreate@12'
CMakeFiles\marsyas.dir/objects.a(RtAudio.cpp.obj):RtAudio.cpp:(.text+0x4b52): undefined reference to `DirectSoundCaptureEnumerate
@8'
CMakeFiles\marsyas.dir/objects.a(RtAudio.cpp.obj):RtAudio.cpp:(.text+0x4bc2): undefined reference to `DirectSoundCaptureCreate@12

CMakeFiles\marsyas.dir/objects.a(RtAudio.cpp.obj):RtAudio.cpp:(.text+0x5f6a): undefined reference to `DirectSoundEnumerateA@8'
CMakeFiles\marsyas.dir/objects.a(RtAudio.cpp.obj):RtAudio.cpp:(.text+0x6439): undefined reference to `DirectSoundCaptureEnumerate
@8'
CMakeFiles\marsyas.dir/objects.a(RtAudio.cpp.obj):RtAudio.cpp:(.text+0x6623): undefined reference to `DirectSoundCreate@12'
CMakeFiles\marsyas.dir/objects.a(RtAudio.cpp.obj):RtAudio.cpp:(.text+0x6ad7): undefined reference to `DirectSoundCaptureCreate@12

CMakeFiles\marsyas.dir/objects.a(RtAudio.cpp.obj):RtAudio.cpp:(.text+0x78dc): undefined reference to `DirectSoundEnumerateA@8'
CMakeFiles\marsyas.dir/objects.a(RtAudio.cpp.obj):RtAudio.cpp:(.text+0x78fb): undefined reference to `DirectSoundCaptureEnumerate
@8'
CMakeFiles\marsyas.dir/objects.a(RtAudio.cpp.obj):RtAudio.cpp:(.text+0x7e04): undefined reference to `DirectSoundEnumerateA@8'
CMakeFiles\marsyas.dir/objects.a(RtAudio.cpp.obj):RtAudio.cpp:(.text+0x7e23): undefined reference to `DirectSoundCaptureEnumerate
@8'
CMakeFiles\marsyas.dir/objects.a(RtAudio.cpp.obj):RtAudio.cpp:(.text+0xa28c): undefined reference to `DirectSoundEnumerateA@8'
CMakeFiles\marsyas.dir/objects.a(RtAudio3.cpp.obj):RtAudio3.cpp:(.text+0x533): undefined reference to `DirectSoundCaptureCreate@1
'
CMakeFiles\marsyas.dir/objects.a(RtAudio3.cpp.obj):RtAudio3.cpp:(.text+0x55f): undefined reference to `DirectSoundCreate@12'
CMakeFiles\marsyas.dir/objects.a(RtAudio3.cpp.obj):RtAudio3.cpp:(.text+0x200b): undefined reference to `DirectSoundEnumerateA@8'
CMakeFiles\marsyas.dir/objects.a(RtAudio3.cpp.obj):RtAudio3.cpp:(.text+0x20bf): undefined reference to `DirectSoundCaptureEnumera
eA@8'
CMakeFiles\marsyas.dir/objects.a(RtAudio3.cpp.obj):RtAudio3.cpp:(.text+0x37a3): undefined reference to `DirectSoundCaptureEnumera
eA@8'
CMakeFiles\marsyas.dir/objects.a(RtAudio3.cpp.obj):RtAudio3.cpp:(.text+0x37cc): undefined reference to `DirectSoundEnumerateA@8'
CMakeFiles\marsyas.dir/objects.a(RtAudio3.cpp.obj):RtAudio3.cpp:(.text+0x388e): undefined reference to `DirectSoundCaptureCreate@
2'
CMakeFiles\marsyas.dir/objects.a(RtAudio3.cpp.obj):RtAudio3.cpp:(.text+0x3916): undefined reference to `DirectSoundCreate@12'
CMakeFiles\marsyas.dir/objects.a(RtAudio3.cpp.obj):RtAudio3.cpp:(.text+0x4633): undefined reference to `DirectSoundEnumerateA@8'
CMakeFiles\marsyas.dir/objects.a(RtAudio3.cpp.obj):RtAudio3.cpp:(.text+0x4668): undefined reference to `DirectSoundCreate@12'
CMakeFiles\marsyas.dir/objects.a(RtAudio3.cpp.obj):RtAudio3.cpp:(.text+0x4dcd): undefined reference to `DirectSoundCaptureEnumera
eA@8'
CMakeFiles\marsyas.dir/objects.a(RtAudio3.cpp.obj):RtAudio3.cpp:(.text+0x4e02): undefined reference to `DirectSoundCaptureCreate@
2'
CMakeFiles\marsyas.dir/objects.a(RtAudio3.cpp.obj):RtAudio3.cpp:(.text+0x7782): undefined reference to `DirectSoundEnumerateA@8'
CMakeFiles\marsyas.dir/objects.a(RtAudio3.cpp.obj):RtAudio3.cpp:(.text+0x77a0): undefined reference to `DirectSoundCaptureEnumera
eA@8'
CMakeFiles\marsyas.dir/objects.a(RtAudio3.cpp.obj):RtAudio3.cpp:(.text+0x7852): undefined reference to `DirectSoundEnumerateA@8'
CMakeFiles\marsyas.dir/objects.a(RtAudio3.cpp.obj):RtAudio3.cpp:(.text+0x7873): undefined reference to `DirectSoundCaptureEnumera
eA@8'
collect2: ld returned 1 exit status
make[2]: *** [lib/libmarsyas.dll] 错误 1
make[1]: *** [marsyas/CMakeFiles/marsyas.dir/all] 错误 2
make: *** [all] 错误 2

蛋疼。不过幸运的是发现vs下编译正常,问题出在哪里呢?难道是DirectX和MinGW脑矛盾了。。。

后记:

The problem is caused between DirectX and MinGW.

Solution: install dx for mingw http://alleg.sourceforge.net/wip.html

Thanks @gad

 



关于 McKelvin

a hacker who's interested in `music computing` and `network security`.
此条目发表在 Work 分类目录。将固定链接加入收藏夹。
  • gad

    也遇到相同问题,折腾了几个上午,终于解决了,就是找不到dsound库的问题。
    使用cmake配置mingw环境的时候,dsound路径被配置成path里的dsound.dll,但这里好像是需要libdsound.a 这个archive文件,在这里下dx for mingw http://alleg.sourceforge.net/wip.html 解压后,在cmake配置时候,点advance,然后找到DSOUND_LIBRARY,改成上面解压文件里的libdsound.a的路径。再config,generate,编译成功了。 几个月了都...

    McKelvin 回复:

    @gad, 果然是Dx 和mingw有关的的问题啊!终于被你找出来了!我后来就一直在linux下写了。