0
0

Ok, now before you jump on me, yes I searched the forums, and yes I included the right FMOD library.

When I try to compile my project using the normal C interface all works fine, but when I try using the classes, like:

[code:3kf3vyf7]
fmodRes = fmodSystem->createStream((char*)CurrentSong->GetFile(), fmodMode, NULL, &fmodSound);

fmodRes = fmodSystem->playSound((FMOD_CHANNELINDEX)0, fmodSound, false, &fmodChannel);
[/code:3kf3vyf7]

i get an unresolved external error

[code:3kf3vyf7]
player.obj : error LNK2019: unresolved external symbol "public: enum FMOD_RESULT __stdcall FMOD::System::playSound(enum FMOD_CHANNELINDEX,class FMOD::Sound *,int,class FMOD::Channel * *)" (?playSound@System@FMOD@@QAG?AW4FMOD_RESULT@@W4FMOD_CHANNELINDEX@@PAVSound@2@HPAPAVChannel@2@@Z) referenced in function "public: enum FMOD_RESULT __thiscall Player::Load(class XMPSong *)" (?Load@Player@@QAE?AW4FMOD_RESULT@@PAVXMPSong@@@Z)
[/code:3kf3vyf7]

now, im not overly concerned with this, cuz i’ll just go right back to the C interface, but for some reason I cannot get it to compile. But the strange thing is, if I comment out the line:

[code:3kf3vyf7]
//fmodRes = fmodSystem->playSound((FMOD_CHANNELINDEX)0, fmodSound, false, &fmodChannel);
[/code:3kf3vyf7]
like that, the project compiles ok.
its only a few functions that throw the error.

If i just try to compile this:
[code:3kf3vyf7]
fmodRes = fmodSystem->createStream((char*)CurrentSong->GetFile(), fmodMode, NULL, &fmodSound);
[/code:3kf3vyf7]

it will compile fine. Also, all of the system init and creation functions compile fine too.

So any ideas why the other function throws the error? I read in a previous thread about defining WIN32. Yes i created an empty project and defined that. Please help me figure out what im doing wrong. Im such a c++ noob lol. I am using windows vista business and visual studio 2008 pro edition

  • You must to post comments
0
0

Use a #error or #pragma message in fmod.h and see which if/else part of the header is being included.

[code:203qs0o8]

if defined(CYGWIN32)

#define F_CDECL __cdecl
#define F_STDCALL __stdcall
#define F_DECLSPEC __declspec
#define F_DLLEXPORT ( dllexport )

elif (defined(WIN32) || defined(WIN32) || defined(_WIN64) || defined(_XBOX))

#define F_CDECL _cdecl
#define F_STDCALL _stdcall
#define F_DECLSPEC __declspec
#define F_DLLEXPORT ( dllexport )

elif defined(MACH)

#define F_CDECL
#define F_STDCALL
#define F_DECLSPEC
#define F_DLLEXPORT __attribute__ ((visibility("default")))

else

#define F_STDCALL
#define F_CDECL
#define F_DECLSPEC
#define F_DLLEXPORT

endif

[/code:203qs0o8]

It should be the 2nd lot

  • You must to post comments
0
0

well, in visual studio, the code that is inactive is greyed out. yes the second batch is executed, i used a #error just to make sure.

[code:glohz0ws]

elif (defined(WIN32) || defined(WIN32) || defined(_WIN64) || defined(_XBOX))

#define F_CDECL _cdecl
#define F_STDCALL _stdcall
#define F_DECLSPEC __declspec
#define F_DLLEXPORT ( dllexport )

[/code:glohz0ws]

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.