View Single Post
Old 18 June 2009, 08:52 am   #56
Dr. Fiemost
Member
 
Join Date: Jun 2008
Posts: 9
Default

Quote:
Originally Posted by slomo View Post
Well, currently libmpcdec exports some symbols which probably shouldn't be exported:

Cnk
Cnk_len
Cnk_lost
Res_bit
_Huffman_MakeTree
_Huffman_PrintCodes
__Cc
__Dc
crc32
huff_init_lut
streaminfo_encoder_info
streaminfo_gain
streaminfo_read_header_sv7
streaminfo_read_header_sv8


These should probably get a "mpc_" prefix or should not be exported at all. The most critical one here is "crc32", if you use libmpcdec in an application that also uses zlib (which exports crc32 too, with a different signature) you're unable to decode sv8 files because stuff simply segfaults.
I've experienced crashes when compiling static library on Windows, since my app links to zlib too which exports the crc32 symbol.
I put together a patch to use __declspec(dllexport) which solves the issue for shared libs, but I don't know how to fix this when building static, other than renaming the function.
Anyone have any clue?
Dr. Fiemost is offline   Reply With Quote