0
0

I’m getting the following linker errors using fmod361 with mingw using gcc3.2

[code:1vr2fv0s]cd c:/projects/mixer/
mingw32-make.exe -k
g++ -W -LC:\api\SDL-1.2.5\i386-mingw32msvc\lib -LC:\api\fmodapi361win32\api\lib -mwindows -lmingw32 -lSDLmain -lSDL -lfmod -o test test.o mixer.o
mixer.o(.text+0x6eb):mixer.cpp: undefined reference to FSOUND_GetVersion@0'
mixer.o(.text+0x72e):mixer.cpp: undefined reference to
FSOUND_Init@12′
mixer.o(.text+0x758):mixer.cpp: undefined reference to FSOUND_GetMaxChannels@0'
mixer.o(.text+0x7db):mixer.cpp: undefined reference to
FSOUND_Close@0′
mingw32-make.exe: *** [test] Error 1

Compilation exited abnormally with code 2 at Fri Apr 11 00:10:17
[/code:1vr2fv0s]

My make file looks like this. The libraries are all there.

[code:1vr2fv0s]
compile_cpp = g++ -W -IC:\api\SDL-1.2.5\i386-mingw32msvc\include\SDL -IC:\api\fmodapi361win32\api\inc -mwindows -c
compile_o = g++ -W -LC:\api\SDL-1.2.5\i386-mingw32msvc\lib -LC:\api\fmodapi361win32\api\lib -mwindows -lmingw32 -lSDLmain -lSDL -lfmod -o

test : test.o mixer.o
$(compile_o) test test.o mixer.o
test.o : test.cpp
$(compile_cpp) test.cpp
mixer.o : mixer.cpp mixer.h g_defines.h
$(compile_cpp) mixer.cpp
[/code:1vr2fv0s]

Any insight would be greatly appreciated. I’ve looked through the archives but couldn’t find an answer.

Thankls,

Andy

  • You must to post comments
0
0

fmod362 didn’t make any difference, but linking the libfmod.a directly rather than including it as a library did, i.e.

[code:1sz4y59z]
g++ -o test test.o mixer.o C:\api\fmodapi362win32\api\lib\libfmod.a
[/code:1sz4y59z]
while
[code:1sz4y59z]
g++ -LC:\api\fmodapi362win32\api\lib\ -lfmod -o test test.o mixer.o
[/code:1sz4y59z]
give undefined reference errors as if the library was never found.

I’m new to gcc so maybe it’s something I’m not doing right there.

Thanks,

Andy

  • You must to post comments
0
0

I think it’s the fact you must link last.. i.e.
gcc my_file.c -o my_flile.exe -lfmod

It could also be the case you have your files copied to the wrong directory or multiple files are conflicting.

  • You must to post comments
0
0

Yea that’s it. When gcc links archive files it only looks for symbols that have been referenced but not yet defined. Thanks.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.