김남규
김남규

Reputation: 11

How can I solve this error?(Using FMOD in QT Creator)

After build, I saw this message.

g++: unrecognized option '-C:\Program Files\FMOD SoundSystem\FMOD Programmers API Windows\api\lib'

I added this 2 lines in gui.pro File

INCLUDEPATH += -"C:\Program Files\FMOD SoundSystem\FMOD Programmers API Windows\api\inc\"

LIBS += -"C:\Program Files\FMOD SoundSystem\FMOD Programmers API Windows\api\lib\"

How can I solve this error?

Upvotes: 0

Views: 673

Answers (1)

Benjamin Maurer
Benjamin Maurer

Reputation: 3753

You need to add the include path, to the headers, without the '-' in the beginning and AFAIK also without the trailing '\':

INCLUDEPATH += "C:\Program Files\FMOD SoundSystem\FMOD Programmers API Windows\api\inc"

Libs needs to start with -L. But that is not enough! That just adds a path to the search paths for libraries. You also need to tell the linker which library to link with. I don't know which one you need, but for a static library called libfmod.a you would add "-lfmod", i.e.:

LIBS += -L"C:\Program Files\FMOD SoundSystem\FMOD Programmers API Windows\api\lib\" -lfmod

There are some other ways to do this. For example adding different libraries for different types of builds (debug vs. release). You might want to use the Qt Creator GUI for that

EDIT: Exactly what I just wrote: http://qt-project.org/doc/qt-4.8/qmake-project-files.html#declaring-other-libraries

EDIT2:

OK, it seems for your particular case there might be another problem. This StackOverflow answer states, that the FMOD library was built with the Microsoft Visual Studio Compiler and that it handles name mangling for functions different from GCC. So they say you have to use the C-API instead.

That was in 2011 though. I don't have that library or a Windows machine at hand. They unfortunately only offer the installer for download, so you have to check yourself if there is some README or Documentation available.

Upvotes: 1

Related Questions