Converting play_sound.cpp example to C-syntax. Linker errors ensued

(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!

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?

1 Like

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?

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.