I'm trying to use FMOD in my program, but I'm having trouble linking the library.
Under the "OS Specific Issues" in the manual, it listed several compliers and which lib/a to use with each of them, but Code::Blocks wasn't listed. I ended up just trying all the different ones, but always got this linker error:
I'm including the header files fmod.hpp and fmod_errors.h. Does anyone know what my problem might be?
Linking executable: opengltemp.exe
.objs\main.o:main.cpp:(.text+0x3ace): undefined reference to `_ZN4FMOD6System4initEijPv@16'
.objs\main.o:main.cpp:(.text+0x3b09): undefined reference to `_ZN4FMOD6System12createStreamEPKcjP22FMOD_CREATESOUNDEXINFOPPNS_5SoundE@20'
.objs\main.o:main.cpp:(.text+0x3b43): undefined reference to `_ZN4FMOD6System9playSoundE17FMOD_CHANNELINDEXPNS_5SoundEbPPNS_7ChannelE@20'
collect2: ld returned 1 exit status
Alright, for mingw it says to use libfmodexp.a. So I click
Build > Compiler Options > Linker > Add > Then added libfmodexp.a.
It still presents the same errors, am I linking it incorrectly?
Same error means unsuccessful linkage. Make sure that you specify the path to the required library - if your version of code::blocks lets you select the library to add via a file common dialog box then use that to ensure the path to the library is fully specified. Otherwise you'll need to add the path to the fmod library in the project-directories-linker options.
Well I think its finding it file, because when it can't it tells me "file not found: libfmodex.a"
I did try the things you suggested though.
Are there any other possibilities you know of?
you can not use the C++ interface of FMOD with minGW. You have to use the C implementation. Also you may want to consider using irrKlang. it works well, and is much easier to use. ( although FMOD is definitely not difficult). Good Luck