Search code examples
c++linkerfmod

unable to link FMOD library to VS2010 project


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?


Solution

  • 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)...