Mingw undefined reference to `FMOD_System_CreateDSPByType'

Hi folks,

I’m using mingw to link a custom library that uses FMOD and FMOD Studio. I’m using the c api since I don’t want to switch to vsc at this moment.

My build process involves linking my object files with the fmod and fmodstudio .dll files from the api binaries using -L, and that works fine for most system and studio functions (e.g. FMOD_Studio_System_Create) but for some reason mingw is only unable to find DSP related functions.

I know that at least two functions cannot be found:
FMOD_System_CreateDSPByType
FMOD_DSP_SetParameterInt

I haven’t tested any more functions as it doesn’t make sense to write more dsp related code until I can resolve this.

If it matters, I’m using the api headers and binaries from FMOD Studio API Windows x64 (v2.02.06)

Am I missing something in my build steps? Perhaps there is a 3rd .dll for DSP that I didn’t know about? Thank you all!

I have found that FMOD_System_CreateDSPByType and FMOD_DSP_SetParameterInt are working correctly. What are your compile commands? I have found the following works correctly:

gcc -c mylibrary.c -o mylibrary.o                         # compile mylibrary.o
gcc -shared -o mylibrary.dll mylibrary.o -L. -lfmod       # create mylibrary.dll
gcc myprogram.c -o myprogram -I. -L. -lmylibrary -lfmod   # compile executable using both fmod.dll mylibrary.dll

Are you linking fmod.dll in both the dll creation command and the program compilation command?

Hi Jeff,

thank you kindly for responding to my question!
For me the failure occurs in the second step (creation of mylibrary.dll)

I have tried several variations of this command, but the command I have been using is

g++ -shared -o D:\Coding\pengine\libs\windows64\penginelib64.dll D:\Coding\pengine\jni\target\windows64\com.phonygames.pengine.audio.fmod.PFmodInterface.o D:\Coding\pengine\jni\target\windows64\memcpy_wrap.o -L D:\Coding\pengine\jni\lib\* libfmod.a

The above command causes the error. If it matters, the library I am using uses c++11 (which in turn is intended to be used with Java via JNI) - is it weird to use the c interface with c++?

my g++ -v ouputs:

gcc version 4.8.2 (x86_64-win32-seh, Built by MinGW-W64 project)

Thanks,
Jason

I see you are using the .a import library, so you are compiling for x86 then? If not then you can try linking fmod.dll directly.

Nope, should be fine. That all looks like it should work, unless something in your first command isn’t working. What does your compile library command look like?

1 Like

Hi Jeff, Thank you for the help!

Thank you for the help!! I’m compiling for x64, the .a import was because i was desperate ( :
Embarassingly, simply including fmod.dll worked! I thought it would be enough to include it via the -L flag, as that worked for all the other functions. Not sure why those specific functions require that fmod.dll be specified differently in the compile command.

Jason

1 Like