无法将FMOD库链接到VS2010项目

发布于 2024-12-17 18:51:46 字数 1098 浏览 1 评论 0原文

我正在尝试将 FMOD 链接到我的项目,我过去在 Visual Studio 2008 中很容易做到这一点......所以我将 fmodex_vc.lib 和 fmodex.dll 文件放在我的项目目录中,将它们添加到我的项目中解决方案资源管理器,然后创建一个 SoundMgr.h 文件,其中包含 fmod.h 文件

#include "include\fmod\fmod.h"

,其中 fmod 已放置在 include\fmod 文件夹中,如果我右键单击上面的代码并单击“打开文档”,则可以打开...

但是如果我尝试编写任何代码,包括一个简单的“使用命名空间 FMOD”,它告诉我 FMOD 未声明或未识别......我是否错过了任何步骤?

编辑: 到目前为止,该类的外观是:

#pragma once
#include "main.h"

#include "include\fmod\fmod.hpp"
#include "include\fmod\fmod_errors.h"
#include "include\fmod\fmod.h"

class SoundMgr{

    void init();


};


    void SoundMgr::init(){
    FSOUND_Init (44100, 32, 0);

    }

错误是:

Error   1   error C3861: 'FSOUND_Init': identifier not found 

这适用于我尝试从本快速指南导入的示例代码的任何行: GameDev FMOD 快速指南< /a>

我尝试将库添加为属性/链接器的输入部分中的附加依赖项,但出现

1. fatal error LNK1181: cannot open input file 'fmodex_vc.lib'

任何这些错误?

I am trying to link FMOD to my project, which I did very easily in the past in Visual Studio 2008.... So I have placed the fmodex_vc.lib and the fmodex.dll file in my project directory, added them to my project's solution explorer, then created a SoundMgr.h file which includes the fmod.h file

#include "include\fmod\fmod.h"

Where fmod has been placed in the include\fmod folder and opens ok if i right click on the above code and click "Open Document"...

But if I try to write any code at all, including a simple "using namespace FMOD" it tells me that it FMOD is undeclared or unidentified.... am I missing any step?

EDIT:
What the class looks like so far is:

#pragma once
#include "main.h"

#include "include\fmod\fmod.hpp"
#include "include\fmod\fmod_errors.h"
#include "include\fmod\fmod.h"

class SoundMgr{

    void init();


};


    void SoundMgr::init(){
    FSOUND_Init (44100, 32, 0);

    }

And the error is:

Error   1   error C3861: 'FSOUND_Init': identifier not found 

And that's for any line of the sample code that I try import from this quick guide:
GameDev FMOD quick guide

I tried adding the library as an additional dependency in the Input section of the Properties/Linker and I get

1. fatal error LNK1181: cannot open input file 'fmodex_vc.lib'

Any of these errors ring a bell?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一念一轮回 2024-12-24 18:51:47

您不想让 fmod.hpp 获得 C++ 功能吗?

Don't you want fmod.hpp to get the c++ features?

家住魔仙堡 2024-12-24 18:51:47

您可以在 C/C++ > 中包含标头路径链接器属性的常规路径和库路径,并在项目中包含 dll。在这种情况下,您的发布/调试目录中有文件

you can include the headers path in C/C++ > General and library path to Linker properties and include the dll's in you project. In this case you have the files in you release/debug dir

独闯女儿国 2024-12-24 18:51:47

是的,所以我最终通过删除链接器输入部分中的附加依赖项并在 Configuration Properties\VC++ 目录中添加 Include 和 Library 目录来修复它。...我发现的大多数文章建议使用 FMOD 的实际完整路径安装文件夹,但由于我希望这个项目是可移植和自包含的,所以我在项目中创建了一个“lib”和“include”文件夹,并将这些文件放入其中...(使用目录“\lib”和“\包含”在项目属性中,我假设链接到该项目文件夹,以前从未这样做过,但希望如果我在不同的机器上编译它,它不会导致依赖性问题)...

Right so I eventually fixed it by removing the Additional Dependency in the Input section of the Linker and instead adding Include and Library directories in in Configuration Properties\VC++ directories.... Most articles I found advise to use the actual full path to the FMOD installation folder, but since I want this project to be portable and self contained, i created a "lib" and "include" folder in my project and put those files in them... (used the directories "\lib" and "\include" in the project properties which I am assuming links to the project folder, have never done this before but am hoping it won't cause dependency issues if I compile this on a different machine)...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文