fmod VS2008 依赖项目中未解析的外部
我目前正在尝试在我的项目中使用最新的稳定 fmod ex。
我在一个名为engine4的项目中有一个主要可执行文件,在解决方案中还有一个名为DX9Platform的项目以及ti所依赖的项目。所有 fmod 代码都在这个 DX9Platform 项目中,该项目生成一个 lib 文件。
DX9Platform 包含 fmodex_vc.lib 并且构建良好。但是,构建 Engien4 会导致无法解析的外部符号消息引用在 DX9Platform 项目中使用 fmod 的文件
我尝试将 fmodex_vc.lib 添加到 Engine4 项目中,但没有成功,如何解决此问题?
这是链接器输出:
3>------ Build started: Project: Engine4, Configuration: Release Direct3D9 Win32 ------
3>Linking...
3>DX9PlatformLib.lib(CFmodSound.obj) : error LNK2001: unresolved external symbol _FMOD_System_Create
3>DX9PlatformLib.lib(CFmodSound.obj) : error LNK2001: unresolved external symbol "public: enum FMOD_RESULT __thiscall FMOD::System::createSound(char const *,unsigned int,struct FMOD_CREATESOUNDEXINFO *,class FMOD::Sound * *)" (?createSound@System@FMOD@@QAE?AW4FMOD_RESULT@@PBDIPAUFMOD_CREATESOUNDEXINFO@@PAPAVSound@2@@Z)
3>DX9PlatformLib.lib(CFmodSound.obj) : error LNK2001: unresolved external symbol "public: enum FMOD_RESULT __thiscall FMOD::System::getVersion(unsigned int *)" (?getVersion@System@FMOD@@QAE?AW4FMOD_RESULT@@PAI@Z)
3>DX9PlatformLib.lib(CFmodSound.obj) : error LNK2001: unresolved external symbol "public: enum FMOD_RESULT __thiscall FMOD::System::init(int,unsigned int,void *)" (?init@System@FMOD@@QAE?AW4FMOD_RESULT@@HIPAX@Z)
3>DX9PlatformLib.lib(CFModAudioObject.obj) : error LNK2001: unresolved external symbol "public: enum FMOD_RESULT __thiscall FMOD::System::playSound(enum FMOD_CHANNELINDEX,class FMOD::Sound *,bool,class FMOD::Channel * *)" (?playSound@System@FMOD@@QAE?AW4FMOD_RESULT@@W4FMOD_CHANNELINDEX@@PAVSound@2@_NPAPAVChannel@2@@Z)
3>DX9PlatformLib.lib(CFModAudioObject.obj) : error LNK2001: unresolved external symbol "public: enum FMOD_RESULT __thiscall FMOD::Channel::getPaused(bool *)" (?getPaused@Channel@FMOD@@QAE?AW4FMOD_RESULT@@PA_N@Z)
3>DX9PlatformLib.lib(CFModAudioObject.obj) : error LNK2001: unresolved external symbol "public: enum FMOD_RESULT __thiscall FMOD::Channel::setPaused(bool)" (?setPaused@Channel@FMOD@@QAE?AW4FMOD_RESULT@@_N@Z)
3>DX9PlatformLib.lib(CFModAudioObject.obj) : error LNK2001: unresolved external symbol "public: virtual class IAudioObject * __thiscall CFModAudioObject::LoadFile(char const *)" (?LoadFile@CFModAudioObject@@UAEPAVIAudioObject@@PBD@Z)
3>D:\media\desktop\engine4\Engine4\Output\Release Direct3D9\Engine4.exe : fatal error LNK1120: 8 unresolved externals
3>Build log was saved at "file://d:\media\desktop\engine4\Engine4\Engine4\intermediate\Release Direct3D9\BuildLog.htm"
3>Engine4 - 9 error(s), 0 warning(s)
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 1 skipped ==========
I'm currently trying to use the latest stable fmod ex in my project.
I have a main executable in a project called engine4, and a project named DX9Platform in the solution as well which ti depends on. All the fmod code is in this DX9Platform project, which generates a lib file.
DX9Platform includes fmodex_vc.lib and builds fine. However building Engien4 results in unresolved external symbol messages referencing files that use fmod in the DX9Platform project
I have tried adding fmodex_vc.lib to the Engine4 project, with no success, how do I fix this?
Heres the linker output:
3>------ Build started: Project: Engine4, Configuration: Release Direct3D9 Win32 ------
3>Linking...
3>DX9PlatformLib.lib(CFmodSound.obj) : error LNK2001: unresolved external symbol _FMOD_System_Create
3>DX9PlatformLib.lib(CFmodSound.obj) : error LNK2001: unresolved external symbol "public: enum FMOD_RESULT __thiscall FMOD::System::createSound(char const *,unsigned int,struct FMOD_CREATESOUNDEXINFO *,class FMOD::Sound * *)" (?createSound@System@FMOD@@QAE?AW4FMOD_RESULT@@PBDIPAUFMOD_CREATESOUNDEXINFO@@PAPAVSound@2@@Z)
3>DX9PlatformLib.lib(CFmodSound.obj) : error LNK2001: unresolved external symbol "public: enum FMOD_RESULT __thiscall FMOD::System::getVersion(unsigned int *)" (?getVersion@System@FMOD@@QAE?AW4FMOD_RESULT@@PAI@Z)
3>DX9PlatformLib.lib(CFmodSound.obj) : error LNK2001: unresolved external symbol "public: enum FMOD_RESULT __thiscall FMOD::System::init(int,unsigned int,void *)" (?init@System@FMOD@@QAE?AW4FMOD_RESULT@@HIPAX@Z)
3>DX9PlatformLib.lib(CFModAudioObject.obj) : error LNK2001: unresolved external symbol "public: enum FMOD_RESULT __thiscall FMOD::System::playSound(enum FMOD_CHANNELINDEX,class FMOD::Sound *,bool,class FMOD::Channel * *)" (?playSound@System@FMOD@@QAE?AW4FMOD_RESULT@@W4FMOD_CHANNELINDEX@@PAVSound@2@_NPAPAVChannel@2@@Z)
3>DX9PlatformLib.lib(CFModAudioObject.obj) : error LNK2001: unresolved external symbol "public: enum FMOD_RESULT __thiscall FMOD::Channel::getPaused(bool *)" (?getPaused@Channel@FMOD@@QAE?AW4FMOD_RESULT@@PA_N@Z)
3>DX9PlatformLib.lib(CFModAudioObject.obj) : error LNK2001: unresolved external symbol "public: enum FMOD_RESULT __thiscall FMOD::Channel::setPaused(bool)" (?setPaused@Channel@FMOD@@QAE?AW4FMOD_RESULT@@_N@Z)
3>DX9PlatformLib.lib(CFModAudioObject.obj) : error LNK2001: unresolved external symbol "public: virtual class IAudioObject * __thiscall CFModAudioObject::LoadFile(char const *)" (?LoadFile@CFModAudioObject@@UAEPAVIAudioObject@@PBD@Z)
3>D:\media\desktop\engine4\Engine4\Output\Release Direct3D9\Engine4.exe : fatal error LNK1120: 8 unresolved externals
3>Build log was saved at "file://d:\media\desktop\engine4\Engine4\Engine4\intermediate\Release Direct3D9\BuildLog.htm"
3>Engine4 - 9 error(s), 0 warning(s)
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 1 skipped ==========
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这里的技巧是,由于编译器不匹配,使用 C++ API 永远不会起作用,因此请尽可能使用 C API。
另请注意,某些 fmod 文档已过时。某些代码会“编译”,但永远不会完全链接/工作
The trick here is that using the C++ API will never work because of compiler mismatches, so use the C API wherever possible.
Also be aware that some fmod documentation is out of date. Certain code will 'compile' but will never fully link/work
我在 VS2005 下编译的 FMOD 4.32.02 64 位也有同样的问题。但是,32 位版本可以按预期进行链接和工作,因此我目前正在使用它。
实际上,我在使用另一个库 libsndfile 时遇到了完全相同的问题。当我第二次遇到它时,我排除了库编译错误的可能性。显然,您可以使用 任何 64 位库。
幸运的是,您只需设置 编译选项。我还没试过,但是有大量 信息 那里。
I had the same issue with FMOD 4.32.02 64-bit, compiled under VS2005. However, the 32-bit version links and works as expected, so I am currently using that instead.
I actually had the exact same issue when using another library, libsndfile. When I came across it a second time, I ruled out the possibility of the library having been compiled wrong. Apparently, you may get this with any 64-bit library.
Fortunately, all you need to to set a compiler option. I haven't tried it yet, but there is plenty of info out there.