Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » libpng clashing when using own libpng libraries Collapse All
Subject Author Date
Carsten Pedersen Nov 25, 2010 - 6:25 AM

Hi,

We are using the ProfUIS Static MBCS with MFC DLL files ( ymlib, ymd.lib).

We are experiencing the following linker errors when using both ProfUIS and our own code that makes use of libpng, that we compiled as static libs.

The libpng/zilb versions that is supplied with ProfUIS are not the same as the ones we use. When linking, the following errors occur:
1>libpngd.lib(pngerror.obj) : error LNK2005: _png_error already defined in LibPNGDLLCRT-d.lib(pngerror.obj)
1>libpngd.lib(pngerror.obj) : error LNK2005: _png_warning already defined in LibPNGDLLCRT-d.lib(pngerror.obj)
1>libpngd.lib(pngerror.obj) : error LNK2005: _png_chunk_error already defined in LibPNGDLLCRT-d.lib(pngerror.obj)
1>libpngd.lib(pngerror.obj) : error LNK2005: _png_chunk_warning already defined in LibPNGDLLCRT-d.lib(pngerror.obj)
1>libpngd.lib(pngerror.obj) : error LNK2005: _png_set_error_fn already defined in LibPNGDLLCRT-d.lib(pngerror.obj)
1>libpngd.lib(pngerror.obj) : error LNK2005: _png_get_error_ptr already defined in LibPNGDLLCRT-d.lib(pngerror.obj)

Can we let ProfUIS use the system based libpng/zlib or what can we do to avoid this linker error?`

Best regards,

Carsten

Technical Support Nov 29, 2010 - 4:08 AM

We perform periodic updating of the libpng library source code. If you choose some 3 year old release of libpng, the ProfSkin library will work OK. If you need some older release of libpng, we will need to check it before provide you with an answer.

Carsten Pedersen Nov 29, 2010 - 1:31 AM

Thanks for the answer. Since we don’t want to be tied to Prof UIS when using libpng in our other projects, solution 2 is the way to go I think. But can we be sure that our version of libpng/zlib (which are newer versions than yours) won’t cause problems in your ProfSkin code?

Technical Support Nov 26, 2010 - 7:05 AM

There are two solutions:

1) Remove any references to these libraries from your project. I.e. your project will be linked with the libraries provided with Prof-UIS.

2) Remove the #pragma comment lines of code from the ...\Prof-UIS\ProfSkin\StdAfx.cpp file. I.e. Prof-UIS will be linked with your libraries.