Linking FMOD

This is a discussion on Linking FMOD within the C++ Programming forums, part of the General Programming Boards category; I'm trying to use FMOD in my program, but I'm having trouble linking the library. Under the "OS Specific Issues" ...

  1. #1
    Registered User IdioticCreation's Avatar
    Join Date
    Nov 2006
    Location
    Lurking about
    Posts
    229

    Linking FMOD

    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:
    Code:
    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
    I'm including the header files fmod.hpp and fmod_errors.h. Does anyone know what my problem might be?

    Thanks,
    David

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Your compiler is MinGW.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    Registered User IdioticCreation's Avatar
    Join Date
    Nov 2006
    Location
    Lurking about
    Posts
    229
    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?

  4. #4
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    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.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  5. #5
    Registered User IdioticCreation's Avatar
    Join Date
    Nov 2006
    Location
    Lurking about
    Posts
    229
    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?
    Last edited by IdioticCreation; 05-13-2007 at 08:46 PM.

  6. #6
    Registered User
    Join Date
    Nov 2005
    Posts
    673
    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

  7. #7
    Registered User IdioticCreation's Avatar
    Join Date
    Nov 2006
    Location
    Lurking about
    Posts
    229
    Thanks Raigne!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems linking with g++
    By Just in forum Linux Programming
    Replies: 11
    Last Post: 07-24-2006, 01:35 AM
  2. Replies: 8
    Last Post: 04-27-2006, 10:39 AM
  3. FMOD implimentation, how'd you do it?
    By Jeremy G in forum Game Programming
    Replies: 10
    Last Post: 06-12-2004, 12:04 AM
  4. Linking error with DirectDrawCreateEx
    By jjj93421 in forum Game Programming
    Replies: 6
    Last Post: 04-06-2004, 03:57 PM
  5. error with fmod() function
    By minesweeper in forum C++ Programming
    Replies: 3
    Last Post: 08-30-2003, 05:24 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21