PNGlib errors with the Linux static library

So, I just had to refresh an Arch Lnux dev machine, and although most things seem to work, my app build borks due to the linker not finding pnglib functions in juce_PNGLoader.o.

So, juce_PNGLoader.o did build and is in libjuce_debug.a - no errors there.
JUCE_INCLUDE_PNGLIB is defined to 1 in juce_Config.h
I re-ran runpremake
I cleaned everything.

This CodeBlocks project, using maybe 2 SVNs ago (705 or so) was working before. The juce libray uses the ‘custom makefile’ trick, my app builds with CodeBlocks managing the make (both in the same workspace).

I do have PNGlib on the machine, and it may be newer (or older), so I tried to make sure that it used juce’s version by (for each target):
putting juce first in the Project Build options - Linker settings - Link Libraries,
putting juce path in the Project Build options - Search directories Compiler & Linker tabs

What’s odd is that jucedemo works fine, but of course it uses the amalgam now.

Does this ring a bell with anyone? Can’t tell whether zlib and oggvorbis would problems next, but none are reported.


When I do: nm libjuce_debug.a | grep png_read

after pausing to admire my minimal linux skills, I see the correct symbols do seem to be there. Oh, wait, the ones I’m missing all have a ‘U’ not a ‘T’ next to them.

(Man nm) Aha, so that is ‘the symbol is undefined’. So, I wonder is PNG_EXTERN is the problem? Well, in pngconf.h, PNG_EXTERN is defined as blank - the #define PNG_EXTERN extern is commented out.

So, looking through the svn, it looked like my pngconfig was changed from svn? I don’t remember doing that, or perhaps I did by accident (or premake did it?). Reverting that file fixed it. Note that I did not change the extern define as mentioned above.

Random glitch? Or a premake bug?

Anyway, SOLVED for now.