0
0

Hello! I have just started with FMOD, just tried to compile the example in the documentation, but the linker gives me some errors:
[quote="linker":2uqhm3ov]
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)
[/quote:2uqhm3ov]

And this is what I wanted to compile:
[quote="code":2uqhm3ov]

include <fmod.hpp>

include <cstdio>

include <windows.h>

pragma comment(lib, "fmodvc.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);
return (-1);
}

result = system->init(100, FMOD_INIT_NORMAL, 0); // Initialize FMOD.
if (result != FMOD_OK)
{
printf("FMOD error! (%d) \n", result);
return (-1);
}
}
[/quote:2uqhm3ov]

I am using Visual C++ 2005 and have linked fmodvc.lib. Should I link some other libraries? Please help!

  • You must to post comments
0
0

You need to link with fmodex_vc.lib, not fmodvc.lib.

  • You must to post comments
0
0

The same problem with

pragma comment(lib, "fmodex_vc.lib")

  • You must to post comments
0
0

I too get the same errors from the linker, however, I did not use the pragma. I have seen threads with this very problem everywhere, so I did not feel like starting another and clutter the forums even more.

These are my settings:

[b:x4rii11h]Microsoft Visual C++ 2003[/b:x4rii11h]

[quote:x4rii11h][Project Settings] Linker -> Input -> Additional Dependencies: [i:x4rii11h]../../FMOD/api/lib/fmodex_vc.lib[/i:x4rii11h]

[Project Settings] C/C++ -> General -> Additional Include Directories: [i:x4rii11h]../../FMOD/api/inc[/i:x4rii11h][/quote:x4rii11h]

I just cant use the two functions that are in the example, though everything else seems to work.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.