News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

SNV 4813 makeobj_prog error in /utils/dr_rdpng.c with libpng v1.4.8 [Solved]

Started by jspaces, September 16, 2011, 04:14:56 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jspaces

SVN 4813 fails to compile with the following error message.
General info:

  • Arch Linux x86_64
  • gcc v 4.6.1
  • glibc v 2.14
  • libpng v 1.4.8

$ make makeobj_prog
make[1]: Entering directory `/home/space/factory/simutrans-svn/src/simutrans-build/trunk/makeobj'
===> CC  ../utils/dr_rdpng.c
In file included from /usr/include/png.h:417:0,
                from ../utils/dr_rdpng.c:4:
/usr/include/pngconf.h:386:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
/usr/include/pngconf.h:387:12: error: unknown type name '__dont__'
/usr/include/pngconf.h:387:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'it'
/usr/include/pngconf.h:387:29: error: unknown type name 'it'
make[1]: *** [../build/default/utils/dr_rdpng-makeobj.o] Error 1
make[1]: Leaving directory `/home/space/factory/simutrans-svn/src/simutrans-build/trunk/makeobj'
make: *** [makeobj_prog] Error 2

If you require more information, please let me know.
PS Thanks for addressing the building_writer.cc compile issue.

prissi

This seems to be a non-matching header file for libpng, as the only assembler in simutrans is in simgraph.cc, and is deactivated on x64.

jspaces

I have recompiled libpng but still get the same error now using the latest SVN 4816 download. On Arch the headers are in the same package thus may be this is a bug in libpng v 1.4.8 or package?
I do have libpng v 1.2.46 installed (the /usr/include/ links point v 1.4.8 ).
I tried to compile by adding an include statement to utils/simstring.h (may not the correct thing to do but it was quick fix idea)
#include </usr/include/libpng12/pngconf.h>
But now I get a different error:
$ make makeobj_prog
make[1]: Entering directory `/home/space/factory/simutrans-svn/src/simutrans-build/trunk/makeobj'
===> CXX ../besch/writer/building_writer.cc
In file included from ../besch/writer/../../utils/simstring.h:5:0,
                from ../besch/writer/building_writer.cc:2:
/usr/include/libpng12/pngconf.h:1372:9: error: 'charf' does not name a type
/usr/include/libpng12/pngconf.h:1373:9: error: 'charf' does not name a type
/usr/include/libpng12/pngconf.h:1374:9: error: 'z_stream' does not name a type
make[1]: *** [../build/default/besch/writer/building_writer-makeobj.o] Error 1
make[1]: Leaving directory `/home/space/factory/simutrans-svn/src/simutrans-build/trunk/makeobj'
make: *** [makeobj_prog] Error 2

Thus could not see if the later /utils/dr_rdpng.c would compile.
Not sure what to try next though ... any pointers or suggestions?

Thanks

VS

I tried searching a bit some of the more suspicious words you have in output. My guess is that charf and z_stream are types from zlib, which is somehow not found or included. Perhaps there is a clash of defines, too? For the previous try, __dont__ seems to be a wannabe pretty-formatted output of compiler, or a readme file.

Also found this: https://bugs.launchpad.net/ubuntu/+source/libpng/+bug/218409

edit: bleh, also here https://bugzilla.redhat.com/show_bug.cgi?id=494579 That's certainly a lovely way to give errors.

prissi

pngconf.h should be matching the own system and usually does not need to include pngconf.h. But I vaguely remebered that it was quite a mess until I got it working.

wlindley

I encounter the same error, on Fedora 15, 64-bit.  The error comes from this block of code in pngconf.h .  There does not seem to be an INSTALL file anywhere, nor can I find any the alleged explanation anywhere else?

#ifdef PNG_SETJMP_SUPPORTED
/* This is an attempt to force a single setjmp behaviour on Linux.  If
* the X config stuff didn't define _BSD_SOURCE we wouldn't need this.
*/

#  ifdef __linux__
#    ifdef _BSD_SOURCE
#      define PNG_SAVE_BSD_SOURCE
#      undef _BSD_SOURCE
#    endif
#    ifdef _SETJMP_H
    /* If you encounter a compiler error here, see the explanation
     * near the end of INSTALL.
     */
        __pngconf.h__ already includes setjmp.h;
        __dont__ include it again.;
#    endif
#  endif /* __linux__ */

jamespetts

Might I ask - has this been fixed in Standard yet? This appears to be disrupting the compilation of Experimental in Linux.

prissi

Aparently the pngconf is broken for x64 bit systems. I do not have a working linux installation to veryfy that.

jamespetts

Hmm - is it working for 32-bit builds in Standard? The nightly builds for Experimental are failing in 32-bit configurations, too.

Dwachs

This patch fixes compiling for linux64 bit. I can not test right now, whether the patch breaks compiling on other systems (windows, mingw, linux32 etc). Please test!

The patch moves the include "setjmp.h" after including "png.h". makeobj compiles even in case the include setjmp is not there.

Edit: as the patch reverts r4779, the could the include setjmp directive be enclosed in an "#ifdef win" check?

prissi

Aparently for MSVC the order of include must change depending how the lib was built :( but under MinGW both work, so lets have setjump.h after png.h

jspaces

It appears that the issue has been resolved. SVN 4830 finished compiling. Simutrans does start but I presently do not have the time to play at length.