Error trying to use fmod in visual studio

I’m trying to implement the play_sound into my own visual studio project. I couldn’t get it to work, so I copied the code directly from the example into my project. Setup the include directories. However I get the following errors, when trying to build the project.

1>main.obj : error LNK2019: unresolved external symbol “void __cdecl Common_Fatal(char const *,…)” (?Common_Fatal@@YAXPEBDZZ) referenced in function SDL_main
1>main.obj : error LNK2019: unresolved external symbol “void __cdecl ERRCHECK_fn(enum FMOD_RESULT,char const *,int)” (?ERRCHECK_fn@@YAXW4FMOD_RESULT@@PEBDH@Z) referenced in function SDL_main
1>main.obj : error LNK2019: unresolved external symbol “void __cdecl Common_Init(void * *)” (?Common_Init@@YAXPEAPEAX@Z) referenced in function SDL_main
1>main.obj : error LNK2019: unresolved external symbol “void __cdecl Common_Update(void)” (?Common_Update@@YAXXZ) referenced in function SDL_main
1>main.obj : error LNK2019: unresolved external symbol “void __cdecl Common_Exit(int)” (?Common_Exit@@YAXH@Z) referenced in function SDL_main
1>main.obj : error LNK2019: unresolved external symbol “bool __cdecl Common_BtnPress(enum Common_Button)” (?Common_BtnPress@@YA_NW4Common_Button@@@Z) referenced in function SDL_main

Any ideas why this is happening?

Functions prefixed with “Common” are part of our example framework and not part of FMOD itself. This code is added to the examples via common.cpp and common_platform.cpp. Developers would usually replace this code with their own application code.

Oh, that makes sense, thanks.

Sorry to revive a dead topic, but would there be a way to use the common.cpp and common_platform.cpp for my project? I don’t have my own application code to use right now.

These files are included with the FMOD API download, in the examples projects.

1 Like