# linking with MinGW g++ 64bit on win7

**URL:** <https://qa.fmod.com/t/linking-with-mingw-g-64bit-on-win7/11998>\
**Category:** FMOD Engine\
**Created:** [July 26, 2015, 10:23pm UTC](https://qa.fmod.com/t/linking-with-mingw-g-64bit-on-win7/11998 "2015-07-26T22:23:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![FatalDiskError](https://avatars.discourse-cdn.com/v4/letter/f/d9b06d/32.png) [@FatalDiskError](https://qa.fmod.com/u/FatalDiskError)\
**Post date:** [July 26, 2015, 10:23pm UTC](https://qa.fmod.com/t/linking-with-mingw-g-64bit-on-win7/11998/1 "2015-07-26T22:23:51Z")

</div>

Hi,

i read a lot postings regarding linking issues with mingw and also a lot of workarounds. But the official statement is, that i should be able to use fmod also in mingw. I am using

> fmodstudioapi10607win-installer

What have i done to test this so far?

1. I copied the play\_stream.cpp, common.h and common\_platform.h into a testfolder

2. changed the function name to

3. copied all .h and .hpp from the inc-folder to c:\fmod\inc

4. copied fmod64.dll from the lib-folder to c:\fmod\lib

5. created a make-file

> `INCLUDE_PATH = -Ic:/fmod/inc`

> `LIBRARY_PATH = -Lc:/fmod/lib/`

> `LIBS = -lfmod64`

> `all: play_stream.cpp`

> `g++ -std=c++11 play_stream.cpp -o play_stream $(INCLUDE_PATH) $(LIBRARY_PATH) $(LIBS)`

But when i compile (and link) i get a lot of undefined reference like:

```
play_stream.cpp:(.text+0x31): undefined reference to `Common_Init(void**)'

play_stream.cpp:(.text+0x57): undefined reference to `ERRCHECK_fn(FMOD_RESULT, char const*, int)'

play_stream.cpp:(.text+0x67): undefined reference to `FMOD::System::getVersion(unsigned int*)'

play_stream.cpp:(.text+0x81): undefined reference to `ERRCHECK_fn(FMOD_RESULT, char const*, int)'

play_stream.cpp:(.text+0xa2): undefined reference to `Common_Fatal(char const*, ...)'

play_stream.cpp:(.text+0xc0): undefined reference to `FMOD::System::init(int, unsigned int, void*)'

play_stream.cpp:(.text+0xda): undefined reference to `ERRCHECK_fn(FMOD_RESULT, char const*, int)'

play_stream.cpp:(.text+0xe6): undefined reference to `Common_MediaPath(char const*)'

```

---

<div class="post-metadata">

**Author:** ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)\
**Post date:** [July 28, 2015, 5:44am UTC](https://qa.fmod.com/t/linking-with-mingw-g-64bit-on-win7/11998/2 "2015-07-28T05:44:30Z")

</div>

You need to compile and link in common.cpp and common\_platform.cpp

---

<div class="post-metadata">

**Author:** ![FatalDiskError](https://avatars.discourse-cdn.com/v4/letter/f/d9b06d/32.png) [@FatalDiskError](https://qa.fmod.com/u/FatalDiskError)\
**Post date:** [July 29, 2015, 9:24pm UTC](https://qa.fmod.com/t/linking-with-mingw-g-64bit-on-win7/11998/3 "2015-07-29T21:24:20Z")

</div>

> [@](#):
>
> You need to compile and link in common.cpp and common\_platform.cpp

cool, at least that reduced the amount of errors. stupid me that i forgot the cpp´s. All “Common\_…” and “ERRCHECK\_…” are fixed now.

But what is still left are 16 undefined references to “FMOD::System”, “FMOD::Sound” and “FMOD::ChannelControl”. Any idea what i am doing wrong?

---

<div class="post-metadata">

**Author:** ![FatalDiskError](https://avatars.discourse-cdn.com/v4/letter/f/d9b06d/32.png) [@FatalDiskError](https://qa.fmod.com/u/FatalDiskError)\
**Post date:** [July 29, 2015, 9:27pm UTC](https://qa.fmod.com/t/linking-with-mingw-g-64bit-on-win7/11998/4 "2015-07-29T21:27:38Z")

</div>

oh, and btw: I changed the name of “my” init back to “FMOD\_Main()”, so it is back to the original “play\_stream.cpp”

---

<div class="post-metadata">

**Author:** ![BrainBraker](https://avatars.discourse-cdn.com/v4/letter/b/e9a140/32.png) [@BrainBraker](https://qa.fmod.com/u/BrainBraker)\
**Post date:** [November 16, 2019, 1:25pm UTC](https://qa.fmod.com/t/linking-with-mingw-g-64bit-on-win7/11998/5 "2019-11-16T13:25:45Z")

</div>

Hello, i have exactly the same issue with undefined references, is fmod 64 bits compatible with mingw in windows?

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [November 21, 2019, 4:33am UTC](https://qa.fmod.com/t/linking-with-mingw-g-64bit-on-win7/11998/6 "2019-11-21T04:33:54Z")

</div>

> The C API of the supplied libraries are compatible with MinGW (C++ ABI not supported). The 64 bit dll can be linked directly. You will need to use the import library libfmod.a and libfmodstudio.a in order to link the 32 bit dlls.

[https://www.fmod.com/resources/documentation-api?version=2.0&page=platforms-windows.html#libraries](https://www.fmod.com/resources/documentation-api?version=2.0&page=platforms-windows.html#libraries)
