libpng causes error concerning pngconf.h

Bug #218409 reported by dauerflucher
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
libpng (Ubuntu)
Opinion
Wishlist
Unassigned
Declined for Dapper by Marc Deslauriers
Declined for Gutsy by Marc Deslauriers
Declined for Hardy by Marc Deslauriers
Declined for Intrepid by Marc Deslauriers
Declined for Jaunty by Marc Deslauriers

Bug Description

Ubuntu Gutsy Gibbon 7.10 - libpng 1.2.15~beta5-2ubuntu0.1 (bug probably concerned with libpng-dev)

Ubuntu Hardy Heron 8.04 (current dev version) - libpng 1.2.15~beta5-3 (bug probably concerned with libpng-dev)

-

Compiling svn rev 2400 of FIFEngine (http://fifengine.de) via scons.

Building is terminated because of errors:

/usr/include/pngconf.h:317: error: expected constructor, destructor, or type conversion before '.' token
/usr/include/pngconf.h:318: error: '__dont__' does not name a type

-

Commenting out the lines mentioned above in pngconf.h will solve the problem in this case.

Revision history for this message
dauerflucher (dauerflucher) wrote :

Gentoo devs offer a patch for this problem.

--- libpng/pngconf.h
+++ libpng/pngconf.h
@@ -323,8 +323,8 @@
      /* 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.;
+#warning __pngconf.h__ already includes setjmp.h;
+#warning __dont__ include it again.;
 # endif
 # endif /* __linux__ */

Patch taken from:
http://mirrors.usc.edu/pub/linux/distributions/gentoo/media-libs/libpng/files/libpng-1.2.24-pngconf-setjmp.patch

Revision history for this message
Bart de Koning (bratdaking) wrote :

I could confirm this in Ubuntu 8.04 using libpng12-dev 1.2.15~beta5-3

I could solve it using the above mentioned patch from Gentoo

Revision history for this message
Bart de Koning (bratdaking) wrote :

Hey all,

Ubuntu Intrepid Ibex 8.10 - libpng12-dev 1.2.27-1
has the same problem:
compiling imal (http://brneurosci.org/imal.html) using dpkg-buildpackage -rfakeroot gives the following error and exits:

---
In file included from /usr/include/png.h:438,
                 from xmtnimage65.cc:17:
/usr/include/pngconf.h:326: fout: expected constructor, destructor, or type conversion before ‘.’ token
/usr/include/pngconf.h:327: fout: ‘__dont__’ does not name a type
make[1]: *** [xmtnimage65.o] Fout 1
make: *** [build-stamp] Fout 2
dpkg-buildpackage: failure: debian/rules build gave error exit status 2
---

Changing /usr/include/pngconf.h according to the patch described above, solves the problem like it did in Hardy.
Could this be implemented upstream, or is there a good reason not to do so?

Cheers,
Bart

Revision history for this message
Daniel T Chen (crimsun) wrote :

Arguably the applications should be using the correct interfaces...

Changed in libpng:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Christoph Egger (christoph-egger) wrote :

If this is using the wrong interfaces libpng *may* fail with an #error directive. Failing because someone believes putting invalid code somewhere is funny is definitely a bug.

Revision history for this message
cousteau (cousteaulecommandant) wrote :

2009-12-25 and the bug's still there. And although I browsed all the code I was trying to compile searching for "#include <setjmp.h>" I didn't found it, so I don't know why the error even appears.

Commenting those 2 lines on /usr/include/pngconf.h works, and the compiled program works perfectly after that.

(Ubuntu 9.04, it seems to also be in 9.10)

Revision history for this message
Siegfried Gevatter (rainct) wrote :

This is still present in Lucid (1.2.42-1ubuntu1).

Amir (aameli8)
description: updated
summary: - libpng causes error concerning pngconf.h
+ Installing problem under ubuntu 9.10
description: updated
Revision history for this message
Christoph Egger (christoph-egger) wrote : Re: Installing problem under ubuntu 9.10

Aehm what exactly was that supposed to be?

Revision history for this message
Bluppie (benhyper) wrote :

In Ubuntu 10.04 no problems with Calibre 0.7.4.
Look on the link for details.
http://calibre-ebook.com/download_linux

Ryan Steele (rgsteele)
description: updated
summary: - Installing problem under ubuntu 9.10
+ libpng causes error concerning pngconf.h
Revision history for this message
Meekohi (meekohi) wrote :

Just experienced this on Amazon AMI.

Revision history for this message
Meekohi (meekohi) wrote :

Fixed by putting #include "png.h" at the top of my program instead of letting it be included later.

Revision history for this message
michael (reeves-87) wrote :

Invalid code is still present as of 12.04. Header should be fixed to use #error or #warning.

Revision history for this message
Heimen Stoffels (vistaus) wrote :

Why isn't any dev fixing this? It's such an easy-to-apply patch and this bug is open for so many years already!!!

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

It's not being fixed because the upstream libpng project put that there deliberately.

Once you make sure your project is using the same setjmp.h, in lucid and later, you simply need to set PNG_SKIP_SETJMP_CHECK in your application to skip the error.

If you disagree, please debate this issue with the upstream libpng project.

Changed in libpng (Ubuntu):
status: Confirmed → Opinion
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.