1

I want to play an mp3 file so I searched and came to know about FMOD. I downloaded it http://www.fmod.org/download/ (the FMOD Studio Programmer’s API for linux).

Also I was getting errors about fmod.hpp not found so I copied all the header files in the inc folder to the examples folder and got rid of them but I get this now.

Now I tried compiling the play_stream.cpp example but I get this and I have absolutely no idea what i'm looking at.. Can anyone explain what i'm doing wrong?

$ gcc play_stream.cpp
/tmp/ccCYnnTg.o: In function `main':
play_stream.cpp:(.text+0x24): undefined reference to `Common_Init(void**)'
play_stream.cpp:(.text+0x40): undefined reference to `ERRCHECK(FMOD_RESULT)'
play_stream.cpp:(.text+0x54): undefined reference to `FMOD::System::getVersion(unsigned int*)'
play_stream.cpp:(.text+0x64): undefined reference to `ERRCHECK(FMOD_RESULT)'
play_stream.cpp:(.text+0x8b): undefined reference to `Common_Fatal(char const*, ...)'
play_stream.cpp:(.text+0xaf): undefined reference to `FMOD::System::init(int, unsigned int, void*)'
play_stream.cpp:(.text+0xbf): undefined reference to `ERRCHECK(FMOD_RESULT)'
play_stream.cpp:(.text+0xcb): undefined reference to `Common_MediaPath(char const*)'
play_stream.cpp:(.text+0xf5): undefined reference to `FMOD::System::createSound(char const*, unsigned int, FMOD_CREATESOUNDEXINFO*, FMOD::Sound**)'
play_stream.cpp:(.text+0x105): undefined reference to `ERRCHECK(FMOD_RESULT)'
play_stream.cpp:(.text+0x119): undefined reference to `FMOD::Sound::getNumSubSounds(int*)'
play_stream.cpp:(.text+0x129): undefined reference to `ERRCHECK(FMOD_RESULT)'
play_stream.cpp:(.text+0x14d): undefined reference to `FMOD::Sound::getSubSound(int, FMOD::Sound**)'
play_stream.cpp:(.text+0x159): undefined reference to `ERRCHECK(FMOD_RESULT)'
play_stream.cpp:(.text+0x18f): undefined reference to `FMOD::System::playSound(FMOD::Sound*, FMOD::ChannelGroup*, bool, FMOD::Channel**)'
play_stream.cpp:(.text+0x19f): undefined reference to `ERRCHECK(FMOD_RESULT)'
play_stream.cpp:(.text+0x1a4): undefined reference to `Common_Update()'
play_stream.cpp:(.text+0x1b0): undefined reference to `Common_BtnPress(Common_Button)'
play_stream.cpp:(.text+0x1c8): undefined reference to `FMOD::ChannelControl::getPaused(bool*)'
play_stream.cpp:(.text+0x1d8): undefined reference to `ERRCHECK(FMOD_RESULT)'
play_stream.cpp:(.text+0x1f3): undefined reference to `FMOD::ChannelControl::setPaused(bool)'
play_stream.cpp:(.text+0x203): undefined reference to `ERRCHECK(FMOD_RESULT)'
play_stream.cpp:(.text+0x20f): undefined reference to `FMOD::System::update()'
play_stream.cpp:(.text+0x21f): undefined reference to `ERRCHECK(FMOD_RESULT)'
play_stream.cpp:(.text+0x259): undefined reference to `FMOD::ChannelControl::isPlaying(bool*)'
play_stream.cpp:(.text+0x277): undefined reference to `ERRCHECK(FMOD_RESULT)'
play_stream.cpp:(.text+0x28b): undefined reference to `FMOD::ChannelControl::getPaused(bool*)'
play_stream.cpp:(.text+0x2a9): undefined reference to `ERRCHECK(FMOD_RESULT)'
play_stream.cpp:(.text+0x2c5): undefined reference to `FMOD::Channel::getPosition(unsigned int*, unsigned int)'
play_stream.cpp:(.text+0x2e3): undefined reference to `ERRCHECK(FMOD_RESULT)'
play_stream.cpp:(.text+0x2ff): undefined reference to `FMOD::Sound::getLength(unsigned int*, unsigned int)'
play_stream.cpp:(.text+0x31d): undefined reference to `ERRCHECK(FMOD_RESULT)'
play_stream.cpp:(.text+0x329): undefined reference to `Common_Draw(char const*, ...)'
play_stream.cpp:(.text+0x335): undefined reference to `Common_Draw(char const*, ...)'
play_stream.cpp:(.text+0x341): undefined reference to `Common_Draw(char const*, ...)'
play_stream.cpp:(.text+0x34d): undefined reference to `Common_Draw(char const*, ...)'
play_stream.cpp:(.text+0x359): undefined reference to `Common_Draw(char const*, ...)'
play_stream.cpp:(.text+0x365): undefined reference to `Common_BtnStr(Common_Button)'
play_stream.cpp:(.text+0x375): undefined reference to `Common_Draw(char const*, ...)'
play_stream.cpp:(.text+0x381): undefined reference to `Common_BtnStr(Common_Button)'
play_stream.cpp:(.text+0x391): undefined reference to `Common_Draw(char const*, ...)'
play_stream.cpp:(.text+0x39d): undefined reference to `Common_Draw(char const*, ...)'
play_stream.cpp:(.text+0x501): undefined reference to `Common_Draw(char const*, ...)'
play_stream.cpp:(.text+0x50d): undefined reference to `Common_Sleep(unsigned int)'
play_stream.cpp:(.text+0x519): undefined reference to `Common_BtnPress(Common_Button)'
play_stream.cpp:(.text+0x530): undefined reference to `FMOD::Sound::release()'
play_stream.cpp:(.text+0x540): undefined reference to `ERRCHECK(FMOD_RESULT)'
play_stream.cpp:(.text+0x54c): undefined reference to `FMOD::System::close()'
play_stream.cpp:(.text+0x55c): undefined reference to `ERRCHECK(FMOD_RESULT)'
play_stream.cpp:(.text+0x568): undefined reference to `FMOD::System::release()'
play_stream.cpp:(.text+0x578): undefined reference to `ERRCHECK(FMOD_RESULT)'
play_stream.cpp:(.text+0x57d): undefined reference to `Common_Close()'
/tmp/ccCYnnTg.o: In function `FMOD::System_Create(FMOD::System**)':
play_stream.cpp:(.text._ZN4FMOD13System_CreateEPPNS_6SystemE[_ZN4FMOD13System_CreateEPPNS_6SystemE]+0xd): undefined reference to `FMOD_System_Create'
/tmp/ccCYnnTg.o:(.eh_frame+0x4b): undefined reference to `__gxx_personality_v0'
collect2: error: ld returned 1 exit status

2 Answers2

0

You probably need to also include in your project settings the libraries you want to link with. In the case of FMOD, you need to link with

  • libfmod.so
  • libfmodL.so

which are located in .../api/lowlevel/lib or .../api/studio/lib, inside the package you download.

Once this is done, the compiler can find the external symbols your code references to.

chorch
  • 163
  • 1
  • 7
0

The FMOD API now provides makefiles for all the api examples. If you compile the examples with the makefile you will avoid this error. They also use the name "core" instead of "lower_level" for the folder where the libraries and headers are stored.

Tim
  • 1