unresolved external symbol mixing c/c++ code

Hi,
I know that it it a repetitive question over the network, but I cannot understand why my link fails.

I have a c++ static lib which use a lot of thirdparty libs (also in plain c) and all works.

Now I added 2 files wrote in plain C which defines 4 function.
The build process succeed, but when I link the lib to a test application I get:

1
2
3
4
2>AudioLib4d.lib(CInputChannel.obj) : error LNK2019: unresolved external symbol "struct mdc_decoder_t * __cdecl mdc_decoder_new(int)" (?mdc_decoder_new@@YAPAUmdc_decoder_t@@H@Z) referenced in function "public: enum EuroAudioLib::EAudioLibRetVal __thiscall EuroAudioLib::CInputChannel::PrepareRecording(int,unsigned short)" (?PrepareRecording@CInputChannel@EuroAudioLib@@QAE?AW4EAudioLibRetVal@2@HG@Z)
2>AudioLib4d.lib(CInputChannel.obj) : error LNK2019: unresolved external symbol "int __cdecl mdc_decoder_get_double_packet(struct mdc_decoder_t *,unsigned char *,unsigned char *,unsigned short *,unsigned char *,unsigned char *,unsigned char *,unsigned char *)" (?mdc_decoder_get_double_packet@@YAHPAUmdc_decoder_t@@PAE1PAG1111@Z) referenced in function "public: enum EuroAudioLib::EAudioLibRetVal __thiscall EuroAudioLib::CInputChannel::DecodingRecBuffer(float const *,unsigned short)" (?DecodingRecBuffer@CInputChannel@EuroAudioLib@@QAE?AW4EAudioLibRetVal@2@PBMG@Z)
2>AudioLib4d.lib(CInputChannel.obj) : error LNK2019: unresolved external symbol "int __cdecl mdc_decoder_get_packet(struct mdc_decoder_t *,unsigned char *,unsigned char *,unsigned short *)" (?mdc_decoder_get_packet@@YAHPAUmdc_decoder_t@@PAE1PAG@Z) referenced in function "public: enum EuroAudioLib::EAudioLibRetVal __thiscall EuroAudioLib::CInputChannel::DecodingRecBuffer(float const *,unsigned short)" (?DecodingRecBuffer@CInputChannel@EuroAudioLib@@QAE?AW4EAudioLibRetVal@2@PBMG@Z)
2>AudioLib4d.lib(CInputChannel.obj) : error LNK2019: unresolved external symbol "int __cdecl mdc_decoder_process_samples(struct mdc_decoder_t *,unsigned char *,int)" (?mdc_decoder_process_samples@@YAHPAUmdc_decoder_t@@PAEH@Z) referenced in function "public: enum EuroAudioLib::EAudioLibRetVal __thiscall EuroAudioLib::CInputChannel::DecodingRecBuffer(float const *,unsigned short)" (?DecodingRecBuffer@CInputChannel@EuroAudioLib@@QAE?AW4EAudioLibRetVal@2@PBMG@Z)


The only header that that file include is :

#include <stdlib.h>

may is this the cause?

Regards,
Daniele.
Try
1
2
3
4
extern "C"
{
#include "your_third_party_C_lib_headers"
}
Topic archived. No new replies allowed.