I’m using FMOD Ex 4.06.19
Everytime I try to compile, I get the following errors:
/usr/local/include/fmodex/fmod.hpp:44: undefined reference to FMOD_System_Create'
/home/bendeco/audiotest/src/audio_funcs.cpp:67: undefined reference to
FMOD::System::init(int, unsigned int, void*)’

Here’s the relevent portion(s) of my code.

include <fmodex/fmod.hpp>

bool PlayFile(string file)
FMOD::System *system;
FMOD::Sound *sound;
FMOD::Channel *channel;
result = System_Create(&system);
if (result != FMOD_OK) return false;
result = system->init(32, FMOD_INIT_NORMAL, false);
if (result != FMOD_OK) return false;
// Incomplete function
return true;

I have been struggling with this for a while now and can’t seem to come up with a solution. I search around other post and couldn’t find an answer. Any help would greatly be appreciated.

Thanks in advance,

  • You must to post comments

Well I figured out what the problem was,
I needed to modify my Makefile.am to include -lfmodex in the AM_LDFLAGS variable.
The application will now compile, but upon execution, I get the following error:
error while loading shared libraries: libfmodex.so: cannot open shared object file: No such file or directory
This is happening because the library is located in ‘/usr/local/lib’ and the system isn’t looking in that directory for the library. I could create a link to ‘/usr/lib’, but I want to assume that other users won’t know to do that, so I have to modify my Makefile.am file to include this library directory, but I do not know how to do that…

  • You must to post comments

I need some help about a similar problem.
I’m using cygwin/g++.
I downloaded the latest stable FMOD, copied the libmodex.a to /usr/lib, used the -lfmodex switch, and I still get these linker errors:

** Linking **

g++ .o -v -lm -lfmodex -o ../bin/win32/out.exe
Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs
Configured with: /usr/build/package/orig/test.respin/gcc-3.4.4-3/configure –verbose –prefix=/usr –exec-prefix=/usr –sysconfdir=/etc –libdir=/usr/lib –libexecdir=/usr/lib –mandir=/usr/share/man –infodir=/usr/share/info –enable-languages=c,ada,c++,d,f77,pascal,java,objc –enable-nls –without-included-gettext –enable-version-specific-runtime-libs –without-x –enable-libgcj –disable-java-awt –with-system-zlib –enable-interpreter –disable-libgcj-debug –enable-threads=posix –enable-java-gc=boehm –disable-win32-registry –enable-sjlj-exceptions –enable-hash-synchronization –enable-libstdcxx-debug
Thread model: posix
gcc version 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
/usr/lib/gcc/i686-pc-cygwin/3.4.4/collect2.exe -Bdynamic –dll-search-prefix=cyg -o ../bin/win32/ProAmp2.exe /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../crt0.o -L/usr/lib/gcc/i686-pc-cygwin/3.4.4 -L/usr/lib/gcc/i686-pc-cygwin/3.4.4 -L/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../.. main.o player.o -lfmodex -lstdc++ -lm -lgcc -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc
player.o:player.cpp:(.text+0x66d): undefined reference to FMOD::System::getVersion(unsigned int*)@8'
player.o:player.cpp:(.text+0x6e0): undefined reference to
FMOD::System::init(int, unsigned int, void
player.o:player.cpp:(.text+0xa21): undefined reference to FMOD::System::getVersion(unsigned int*)@8'
player.o:player.cpp:(.text+0xa94): undefined reference to
FMOD::System::init(int, unsigned int, void)@16′
player.o:player.cpp:(.text+0xd99): undefined reference to FMOD::System::createStream(char const*, unsigned int, FMOD_CREATESOUNDEXINFO*, FMOD::Sound**)@20'
player.o:player.cpp:(.text+0xde8): undefined reference to
FMOD::System::playSound(FMOD_CHANNELINDEX, FMOD::Sound
, bool, FMOD::Channel**)@20′
player.o:player.cpp:(.text+0xe62): undefined reference to FMOD::System::close()@4'
player.o:player.cpp:(.text+0xe8d): undefined reference to
player.o:player.cpp:(.text+0xf96): undefined reference to FMOD::System::close()@4'
player.o:player.cpp:(.text+0xfc1): undefined reference to
player.o:player.cpp:(.text+0x1092): undefined reference to `FMOD::Sound::release()@4′
collect2: ld returned 1 exit status

> Terminated with exit code 0.

I get the same errors for the example codes. The same thing happened with Dev-C++.
Any ideas why can’t I link the programs?

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.