[flac-dev] Trying to link against libFLAC_static.lib (windows)

Glenn McCord
2012-03-23T05:59:55Z

Hi. I'm trying to get a project linking to libFLAC_static.lib but I
get linker errors such as the following.

6>AudioDecoder.lib(CFlacDecoder.obj) : error LNK2019: unresolved
external symbol
__imp__FLAC__stream_decoder_process_until_end_of_metadata referenced
in function "protected: int __thiscall
CFlacDecoder::CreateDecoder(void)"
(?CreateDecoder at CFlacDecoder@@IAEHXZ)
6>AudioDecoder.lib(CFlacDecoder.obj) : error LNK2019: unresolved
external symbol __imp__FLAC__stream_decoder_init_file referenced in
function "protected: int __thiscall CFlacDecoder::CreateDecoder(void)"
(?CreateDecoder at CFlacDecoder@@IAEHXZ)
6>AudioDecoder.lib(CFlacDecoder.obj) : error LNK2019: unresolved
external symbol __imp__FLAC__stream_decoder_init_ogg_file referenced
in function "protected: int __thiscall
CFlacDecoder::CreateDecoder(void)"
(?CreateDecoder at CFlacDecoder@@IAEHXZ)
6>AudioDecoder.lib(CFlacDecoder.obj) : error LNK2019: unresolved
external symbol __imp__FLAC__stream_decoder_new referenced in function
"protected: int __thiscall CFlacDecoder::CreateDecoder(void)"
(?CreateDecoder at CFlacDecoder@@IAEHXZ)
6>AudioDecoder.lib(CFlacDecoder.obj) : error LNK2001: unresolved
external symbol __imp__FLAC__StreamDecoderStateString
6>AudioDecoder.lib(CFlacDecoder.obj) : error LNK2019: unresolved
external symbol __imp__FLAC__stream_decoder_get_state referenced in
function "int __cdecl die_s_(char const *,struct FLAC__StreamDecoder
const *)" (?die_s_@@YAHPBDPBUFLAC__StreamDecoder@@@Z)
6>AudioDecoder.lib(CFlacDecoder.obj) : error LNK2001: unresolved
external symbol __imp__FLAC__StreamDecoderErrorStatusString
6>AudioDecoder.lib(CFlacDecoder.obj) : error LNK2019: unresolved
external symbol __imp__FLAC__stream_decoder_delete referenced in
function "public: virtual __thiscall
CFlacDecoder::~CFlacDecoder(void)" (??1CFlacDecoder@@UAE at XZ)
6>AudioDecoder.lib(CFlacDecoder.obj) : error LNK2019: unresolved
external symbol __imp__FLAC__stream_decoder_flush referenced in
function "public: int __thiscall CFlacDecoder::Seek(unsigned int)"
(?Seek at CFlacDecoder@@QAEHI at Z)
6>AudioDecoder.lib(CFlacDecoder.obj) : error LNK2019: unresolved
external symbol __imp__FLAC__stream_decoder_seek_absolute referenced
in function "public: int __thiscall CFlacDecoder::Seek(unsigned int)"
(?Seek at CFlacDecoder@@QAEHI at Z)
6>AudioDecoder.lib(CFlacDecoder.obj) : error LNK2019: unresolved
external symbol __imp__FLAC__stream_decoder_process_single referenced
in function "public: int __thiscall CFlacDecoder::DecodeFrame(void)"
(?DecodeFrame at CFlacDecoder@@QAEHXZ)



The __imp__ prefix seems to imply that some kind of .dll usage is
happening, which it shouldn't.

All I need is the C lib, so I just build libFLAC_static from within
VS2010 (I've converted the VS2005 project)

I've then linked to that library by setting the linker settings
General-> "Additional Library Dependencies" and Input->
"Additional
Dependencies" appropriately.

Both the main app and the flac libs are build using the "runtime
library" Multi-Threaded /MT (or /MTd for debug mode)

The flac project is using the preprocessor definitions:

WIN32
NDEBUG
_LIB
FLAC__HAS_OGG
FLAC__CPU_IA32
FLAC__HAS_NASM
FLAC__USE_3DNOW
VERSION="1.2.0"
FLAC__NO_DLL

I'm not sure what else to try at this stage. I've reached the point
where I start going in circles and accessing the same internet search
results. Has anyone got any suggestions?

Thanks

Glenn