# Converting play\_sound.cpp example to C-syntax. Linker errors ensued

**URL:** <https://qa.fmod.com/t/converting-play-sound-cpp-example-to-c-syntax-linker-errors-ensued/12189>\
**Category:** FMOD Engine\
**Created:** [December 7, 2015, 4:29am UTC](https://qa.fmod.com/t/converting-play-sound-cpp-example-to-c-syntax-linker-errors-ensued/12189 "2015-12-07T04:29:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tcushma4](https://avatars.discourse-cdn.com/v4/letter/t/59ef9b/32.png) [@tcushma4](https://qa.fmod.com/u/tcushma4)\
**Post date:** [December 7, 2015, 4:29am UTC](https://qa.fmod.com/t/converting-play-sound-cpp-example-to-c-syntax-linker-errors-ensued/12189/1 "2015-12-07T04:29:04Z")

</div>

(Warning: complete newbie here)

So I’m looking to try my hand at implementation in C, and I’m stumped by some linker errors. Does anyone have any idea where the following function implementations can be found?:

Common\_Init  
Common\_Fatal  
Common\_Update  
Common\_BtnPress  
Common\_Draw  
Common\_BtnStr  
Common\_Close

FMOD\_System\_Create  
FMOD\_System\_GetVersion  
FMOD\_System\_Init  
FMOD\_System\_CreateSound  
FMOD\_System\_PlaySound  
FMOD\_System\_Update  
FMOD\_System\_GetChannelsPlaying  
FMOD\_System\_Close  
FMOD\_System\_Release

ERRCHECK\_fn

FMOD\_Channel\_IsPlaying  
FMOD\_Channel\_GetPaused  
FMOD\_Channel\_GetPosition  
FMOD\_Channel\_GetCurrentSound

FMOD\_Sound\_GetLength  
FMOD\_Sound\_Release  
FMOD\_Sound\_SetMode

It seems like I’m missing something pretty essential. Right now my directory consists of:

- common.cpp
- common.h
- common\_platform.cpp
- common\_platform.h
- fmod.h
- fmod\_codec.h
- fmod\_common.h
- fmod\_dsp.h
- fmod\_dsp\_effects.h
- fmod\_output.h
- play\_sound.c

Any ideas?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)\
**Post date:** [December 7, 2015, 11:30pm UTC](https://qa.fmod.com/t/converting-play-sound-cpp-example-to-c-syntax-linker-errors-ensued/12189/2 "2015-12-07T23:30:05Z")

</div>

Common\_Init  
Common\_Fatal  
Common\_Update  
Common\_BtnPress  
Common\_Draw  
Common\_BtnStr  
Common\_Close

These are all on common.cpp

FMOD\_System\_Create  
FMOD\_System\_GetVersion  
FMOD\_System\_Init  
FMOD\_System\_CreateSound  
FMOD\_System\_PlaySound  
FMOD\_System\_Update  
FMOD\_System\_GetChannelsPlaying  
FMOD\_System\_Close  
FMOD\_System\_Release

FMOD\_Channel\_IsPlaying  
FMOD\_Channel\_GetPaused  
FMOD\_Channel\_GetPosition  
FMOD\_Channel\_GetCurrentSound

FMOD\_Sound\_GetLength  
FMOD\_Sound\_Release  
FMOD\_Sound\_SetMode

These are all in fmod\_vc.lib

Are you linking those 2 things into your project?

---

<div class="post-metadata">

**Author:** ![tcushma4](https://avatars.discourse-cdn.com/v4/letter/t/59ef9b/32.png) [@tcushma4](https://qa.fmod.com/u/tcushma4)\
**Post date:** [December 8, 2015, 9:35pm UTC](https://qa.fmod.com/t/converting-play-sound-cpp-example-to-c-syntax-linker-errors-ensued/12189/3 "2015-12-08T21:35:30Z")

</div>

> [@](#):
>
> Common\_Init  
> Common\_Fatal  
> Common\_Update  
> Common\_BtnPress  
> Common\_Draw  
> Common\_BtnStr  
> Common\_Close
> 
> These are all on common.cpp
> 
> FMOD\_System\_Create  
> FMOD\_System\_GetVersion  
> FMOD\_System\_Init  
> FMOD\_System\_CreateSound  
> FMOD\_System\_PlaySound  
> FMOD\_System\_Update  
> FMOD\_System\_GetChannelsPlaying  
> FMOD\_System\_Close  
> FMOD\_System\_Release
> 
> FMOD\_Channel\_IsPlaying  
> FMOD\_Channel\_GetPaused  
> FMOD\_Channel\_GetPosition  
> FMOD\_Channel\_GetCurrentSound
> 
> FMOD\_Sound\_GetLength  
> FMOD\_Sound\_Release  
> FMOD\_Sound\_SetMode
> 
> These are all in fmod\_vc.lib
> 
> Are you linking those 2 things into your project?

I haven’t been linking those, which is probably my issue. Forgive my ignorance, but am I able to link a .cpp to a C-based project? I thought there would be issues with that. Should I modify the .cpp to fit with C-standards?

As for fmod\_vc.lib, I’m not sure how to properly link that. Where would I go to learn about that?

---

<div class="post-metadata">

**Author:** ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)\
**Post date:** [December 9, 2015, 12:11am UTC](https://qa.fmod.com/t/converting-play-sound-cpp-example-to-c-syntax-linker-errors-ensued/12189/4 "2015-12-09T00:11:49Z")

</div>

you can use FMOD in C no problems, just use fmod.h instead of fmod.hpp, but common is a framework we provide for our examples, just to be able to display text and handle input. I can see some c++ code in there (ie std::vector) so I would just disregard that and use fmod by itself, in your own code.
