# Mingw undefined reference to \`FMOD\_System\_CreateDSPByType'

**URL:** <https://qa.fmod.com/t/mingw-undefined-reference-to-fmod-system-createdspbytype/18711>\
**Category:** FMOD Engine\
**Created:** [April 30, 2022, 3:49am UTC](https://qa.fmod.com/t/mingw-undefined-reference-to-fmod-system-createdspbytype/18711 "2022-04-30T03:49:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![imuh3](https://avatars.discourse-cdn.com/v4/letter/i/3bc359/32.png) [@imuh3](https://qa.fmod.com/u/imuh3)\
**Post date:** [April 30, 2022, 3:49am UTC](https://qa.fmod.com/t/mingw-undefined-reference-to-fmod-system-createdspbytype/18711/1 "2022-04-30T03:49:03Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [May 4, 2022, 4:43am UTC](https://qa.fmod.com/t/mingw-undefined-reference-to-fmod-system-createdspbytype/18711/2 "2022-05-04T04:43:35Z")

</div>

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:

```bash
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?

---

<div class="post-metadata">

**Author:** ![imuh3](https://avatars.discourse-cdn.com/v4/letter/i/3bc359/32.png) [@imuh3](https://qa.fmod.com/u/imuh3)\
**Post date:** [May 4, 2022, 7:36am UTC](https://qa.fmod.com/t/mingw-undefined-reference-to-fmod-system-createdspbytype/18711/3 "2022-05-04T07:36:34Z")

</div>

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

```auto
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:

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

```

Thanks,  
Jason

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [May 6, 2022, 6:49am UTC](https://qa.fmod.com/t/mingw-undefined-reference-to-fmod-system-createdspbytype/18711/4 "2022-05-06T06:49:36Z")

</div>

> [@imuh3](#):
>
> `libfmod.a`

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.

> [@imuh3](#):
>
> is it weird to use the c interface with c++

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?

---

<div class="post-metadata">

**Author:** ![imuh3](https://avatars.discourse-cdn.com/v4/letter/i/3bc359/32.png) [@imuh3](https://qa.fmod.com/u/imuh3)\
**Post date:** [May 7, 2022, 8:16pm UTC](https://qa.fmod.com/t/mingw-undefined-reference-to-fmod-system-createdspbytype/18711/5 "2022-05-07T20:16:52Z")

</div>

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
