I’m linking the Juce library with another library (FreeImage) which comes with its own copy of libPNG, libJPEG and ZLib.
For this reason I get (in Microsoft Visual Studio 2008) the “already defined”/“multiple definitions” linking errors.
I know that juce_Config.h contains some options:
JUCE_INCLUDE_ZLIB_CODE
JUCE_INCLUDE_PNGLIB_CODE
JUCE_INCLUDE_JPEGLIB_CODE
but in my case I prefer not to have “personal” copy of these libraries: for example I include FreeImage.h and link FreeImage.lib without having to deal with library versions. I was wondering if would be possible to add an option to “pack” Juce libPNG/libJPEG/zlib in a private “namespace”.
For example:
namespace pnglibNamespace {
…
//I want the symbols to be exported with namespace
//extern “C”
//{
and modify the “pnglib/png.h”
/*
#ifdef __cplusplus
extern “C” {
#endif
/
…
/
#ifdef __cplusplus
}
#endif
*/
The same would work also for libJPG and zlib.
Thanks,Giorgio.