PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

FMOD Integration to CGAPIAPPLICATION

hi,

I am getting a linking problem :

Linking...
myproject.obj : error LNK2019: unresolved external symbol FSOUND_Init referenced in function "public: __cdecl CMyApplication::CMyApplication(struct _GDAPPCONFIG const &)" (??0CMyApplication@@QAA@ABU_GDAPPCONFIG@@@Z)
ARMRel/MyProject.exe : fatal error LNK1120: 1 unresolved externals

What I have done is the following:

I have created a class called SOUND:

<snip snip>
sound.h :

#ifndef __SOUND_H__
#define __SOUND_H__
#include "fmod.h"
typedef class SOUND {
public:
FMUSIC_MODULE *mod;
SOUND() {
mod = NULL;
FSOUND_Init(12000, 32, FSOUND_INIT_GLOBALFOCUS);
};
....
} SOUND;


<snip snip>

In the main CGAPIApp:

<snip snip>
..
#include "sound.h"

class CMyApplication : public CGapiApplication
{

public:
SOUND sound;
CMyApplication(const GDAPPCONFIG& config) : CGapiApplication(config) {
sound = SOUND();
}

...
}

It compiles fine... but complains when linking...

The fmod library is definitely in the right place...

Can somebody help?

/jomarco
BurningSheep · 02 Aug 2002, 16:41 UTC
Hi there you might want to try the FMOD CE wrapper I wrote for use with pocketfrog, http://forums.pocketmatrix.com/viewtopic.php?p=93987
You can use it under GapiDraw as well with a couple of small changes.

Maybe you can figure out what you're doing wrong by looking through the source. Or just try it out, to determine what the problem exactly is.
jomarco · 02 Aug 2002, 18:51 UTC — RE:
Hi,
Thanks for the help.
I have stripped down your api and it compiles, but I am getting the same linker problems.

I have used

extern "C"
{
#include "fmod.h"
#include "fmod_errors.h"
}

so that the C++ understands the C code.

Still not working. I have recreated a whole new eVC project to make sure that I havent done anything stupid. ie.
1. fmodvc.lib is definitely set up in the project settings link
2. Additional library path is definitely set up to point to where fmodvc.lib lives

I now get the following:

<snip snip>

Linking...
Sound.obj : error LNK2019: unresolved external symbol FSOUND_Init referenced in function "public: __cdecl Sound::Sound(void)" (??0Sound@@QAA@XZ)
Sound.obj : error LNK2019: unresolved external symbol FSOUND_GetVersion referenced in function "public: __cdecl Sound::Sound(void)" (??0Sound@@QAA@XZ)
Sound.obj : error LNK2019: unresolved external symbol FSOUND_Close referenced in function "public: virtual __cdecl Sound::~Sound(void)" (??1Sound@@UAA@XZ)
Sound.obj : error LNK2019: unresolved external symbol FMUSIC_FreeSong referenced in function "public: virtual __cdecl Sound::~Sound(void)" (??1Sound@@UAA@XZ)
Sound.obj : error LNK2019: unresolved external symbol FMUSIC_LoadSong referenced in function "public: bool __cdecl Sound::LoadMod(char *)" (?LoadMod@Sound@@QAA_NPAD@Z)
Sound.obj : error LNK2019: unresolved external symbol FMUSIC_PlaySong referenced in function "public: void __cdecl Sound::PlayMod(void)" (?PlayMod@Sound@@QAAXXZ)
Sound.obj : error LNK2019: unresolved external symbol FMUSIC_StopSong referenced in function "public: void __cdecl Sound::StopMod(void)" (?StopMod@Sound@@QAAXXZ)
ARMRel/HighNoon.exe : fatal error LNK1120: 7 unresolved externals
Error executing link.exe.

<snip snip>

Is there something that I am missing here? I must be doing something wrong.... But I have really run out of ideas...


Please help...

thanks
Jomarco
BurningSheep · 02 Aug 2002, 19:07 UTC
If your building for PPC (arm, mips or sh3) you need the lib specifically for these processors. I get the idea you are trying to use the wrong lib (the visual studio desktop version). You can download FMOD CE 3.51 here: http://www.fmod.org/ifmoddownload.html
yes, you were right!
thank you thnak you thnak you!!!!

Jomarco