Thread: Can't initialize FMOD

  1. #1
    Registered User
    Join Date
    Jan 2006
    Location
    Latvia
    Posts
    102

    Can't initialize FMOD

    Here's my code:
    Code:
    #include <fmod.hpp>
    #include <cstdio>
    #pragma comment(lib, "fmodex_vc.lib")
    
    using namespace std;
    int main()
    {
    FMOD_RESULT result;
    FMOD::System *system;
    
    result = FMOD::System_Create(&system);		// Create the main system object.
    if (result != FMOD_OK)
    {
        printf("FMOD error! (%d) \n", result);
        exit(-1);
    }
    
    result = system->init(100, FMOD_INIT_NORMAL, 0);	// Initialize FMOD.
    if (result != FMOD_OK)
    {
        printf("FMOD error! (%d) \n", result);
        exit(-1);
    }
    
    
    }
    The linker output says:
    Code:
    1>Linking...
    1>SB.obj : error LNK2019: unresolved external symbol _FMOD_System_Create referenced in function "enum FMOD_RESULT __cdecl FMOD::System_Create(class FMOD::System * *)" (?System_Create@FMOD@@YA?AW4FMOD_RESULT@@PAPAVSystem@1@@Z)
    1>SB.obj : error LNK2019: unresolved external symbol "public: enum FMOD_RESULT __thiscall FMOD::System::init(int,unsigned int,void *)" (?init@System@FMOD@@QAE?AW4FMOD_RESULT@@HIPAX@Z) referenced in function _main
    1>C:\Documents and Settings\Olafs.NTWORLD-9BA1E5E\Desktop\Misc\Programming\Visual C++ Projects\SB\Debug\SB.exe : fatal error LNK1120: 2 unresolved externals
    1>SB - 3 error(s), 0 warning(s)
    I can't figure out what's the problem, what other libraries should I link? I just copied and pasted the code from the documentation and added #pragma comment(lib, "fmodex_vc.lib")

    BTW I'm using VC++2005 express

  2. #2
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    Post this on the C board, this is C++ they may know more about the problem.

    You could try downloading the platform SDK for MSVC++2005 express, it does not have it included. Im not sure, but if you included windows.h with your file it may work. As you are calling the system by reference

  3. #3
    Registered User
    Join Date
    Jan 2006
    Location
    Latvia
    Posts
    102
    I've already got the platform SDK and windows.h including didn't help.

  4. #4
    Registered User
    Join Date
    May 2006
    Posts
    903
    I don't know about your problem but you have 'using namespace std;' and you never utilize anything out of the std namespace..

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 04-10-2009, 02:20 AM
  2. how to initialize char *
    By vignesh in forum C Programming
    Replies: 3
    Last Post: 03-30-2009, 01:17 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. error with fmod() function
    By minesweeper in forum C++ Programming
    Replies: 3
    Last Post: 08-30-2003, 05:24 AM
  5. using constructor to initialize data
    By Unregistered in forum C++ Programming
    Replies: 6
    Last Post: 03-19-2002, 08:55 PM