reviczky / pstoedit

pstoedit is a tool converting PostScript and PDF files into various other formats suported by different drawing editors. As a prerequesite it needs GhostScript to be installed (binary installation is sufficient).
http://www.calvina.de/pstoedit/
GNU General Public License v2.0
4 stars 2 forks source link

pstoedit.h:104:74: error: unknown type name ‘bool’ in version 4.0.0 when building in C autotrace #2

Closed Apteryks closed 6 months ago

Apteryks commented 9 months ago

Hi,

Trying to build the latest version 4.0.0 with GCC 11, I get:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/gnu/store/0y1frga3xwcnj0qrzyq2m96nmd4625qq-imagemagick-6.9.13-5/include/ImageMagick-6 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -pthread -I/gn
u/store/z8fw63658ag30p3r20m8im5710as48rh-glib-2.72.3/include/glib-2.0 -I/gnu/store/z8fw63658ag30p3r20m8im5710as48rh-glib-2.72.3/lib/glib-2.0/include -DLOCALEDIR=\"/gnu/store/3yhnspw420c2gds1qb66pb9d559ap5b6-autot
race-0.31.9/share/locale\" -g -O2 -c src/output.c  -fPIC -DPIC -o src/.libs/output.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/gnu/store/0y1frga3xwcnj0qrzyq2m96nmd4625qq-imagemagick-6.9.13-5/include/ImageMagick-6 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -pthread -I/gn
u/store/z8fw63658ag30p3r20m8im5710as48rh-glib-2.72.3/include/glib-2.0 -I/gnu/store/z8fw63658ag30p3r20m8im5710as48rh-glib-2.72.3/lib/glib-2.0/include -DLOCALEDIR=\"/gnu/store/3yhnspw420c2gds1qb66pb9d559ap5b6-autot
race-0.31.9/share/locale\" -g -O2 -c src/input.c  -fPIC -DPIC -o src/.libs/input.o
/gnu/store/p7zqfnpxkqj7im10x2ncpm9l62g3zmnp-bash-minimal-5.1.16/bin/bash ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.   -I/gnu/store/0y1frga3xwcnj0qrzyq2m96nmd4625qq-imagemagick-6.9.13-5/include/I
mageMagick-6 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16   -pthread -I/gnu/store/z8fw63658ag30p3r20m8im5710as48rh-glib-2.72.3/include/glib-2.0 -I/gnu/store/z8fw63658ag30p3r20m8im5710as48rh-g
lib-2.72.3/lib/glib-2.0/include -DLOCALEDIR=\""/gnu/store/3yhnspw420c2gds1qb66pb9d559ap5b6-autotrace-0.31.9/share/locale"\"   -g -O2 -c -o src/despeckle.lo src/despeckle.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/gnu/store/0y1frga3xwcnj0qrzyq2m96nmd4625qq-imagemagick-6.9.13-5/include/ImageMagick-6 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -pthread -I/gn
u/store/z8fw63658ag30p3r20m8im5710as48rh-glib-2.72.3/include/glib-2.0 -I/gnu/store/z8fw63658ag30p3r20m8im5710as48rh-glib-2.72.3/lib/glib-2.0/include -DLOCALEDIR=\"/gnu/store/3yhnspw420c2gds1qb66pb9d559ap5b6-autot
race-0.31.9/share/locale\" -g -O2 -c src/pxl-outline.c  -fPIC -DPIC -o src/.libs/pxl-outline.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/gnu/store/0y1frga3xwcnj0qrzyq2m96nmd4625qq-imagemagick-6.9.13-5/include/ImageMagick-6 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -pthread -I/gn
u/store/z8fw63658ag30p3r20m8im5710as48rh-glib-2.72.3/include/glib-2.0 -I/gnu/store/z8fw63658ag30p3r20m8im5710as48rh-glib-2.72.3/lib/glib-2.0/include -DLOCALEDIR=\"/gnu/store/3yhnspw420c2gds1qb66pb9d559ap5b6-autot
race-0.31.9/share/locale\" -g -O2 -c src/median.c  -fPIC -DPIC -o src/.libs/median.o
In file included from src/output-pstoedit.c:30:
/gnu/store/818c1z92k85kwvvwyv62k58v70psskrh-pstoedit-4.00/include/pstoedit/pstoedit.h:104:48: error: unknown type name ‘std’; did you mean ‘stdin’?
  104 | void loadpstoeditplugins(const char* progname, std::ostream & errstream, bool verbose);
      |                                                ^~~
      |                                                stdin
/gnu/store/818c1z92k85kwvvwyv62k58v70psskrh-pstoedit-4.00/include/pstoedit/pstoedit.h:104:74: error: unknown type name ‘bool’
  104 | void loadpstoeditplugins(const char* progname, std::ostream & errstream, bool verbose);
      |                                                                          ^~~~
In file included from src/output-pstoedit.c:30:
/gnu/store/818c1z92k85kwvvwyv62k58v70psskrh-pstoedit-4.00/include/pstoedit/pstoedit.h:40:1: note: ‘bool’ is defined in header ‘<stdbool.h>’; did you forget to ‘#include <stdbool.h>’?
   39 | #include "pstoedll.h"
  +++ |+#include <stdbool.h>
   40 | 
Apteryks commented 9 months ago

Doing as GCC suggested fixes the build.

Apteryks commented 9 months ago

Another one, exposed while attempting to build autotrace:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/gnu/store/0y1frga3xwcnj0qrzyq2m96nmd4625qq-imagemagick-6.9.1
3-5/include/ImageMagick-6 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -pthread -I/gn
u/store/z8fw63658ag30p3r20m8im5710as48rh-glib-2.72.3/include/glib-2.0 -I/gnu/store/z8fw63658ag30p3r20m8im5
710as48rh-glib-2.72.3/lib/glib-2.0/include -DLOCALEDIR=\"/gnu/store/wwrglnw01kc1d8llkyc759q57h659npk-autot
race-0.31.9/share/locale\" -g -O2 -c src/median.c  -fPIC -DPIC -o src/.libs/median.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/gnu/store/0y1frga3xwcnj0qrzyq2m96nmd4625qq-imagemagick-6.9.1
3-5/include/ImageMagick-6 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -pthread -I/gn
u/store/z8fw63658ag30p3r20m8im5710as48rh-glib-2.72.3/include/glib-2.0 -I/gnu/store/z8fw63658ag30p3r20m8im5
710as48rh-glib-2.72.3/lib/glib-2.0/include -DLOCALEDIR=\"/gnu/store/wwrglnw01kc1d8llkyc759q57h659npk-autot
race-0.31.9/share/locale\" -g -O2 -c src/thin-image.c  -fPIC -DPIC -o src/.libs/thin-image.o
In file included from src/output-pstoedit.c:30:
/gnu/store/9sh42hrzzd6kz86xpga7ppjw6a6rw735-pstoedit-4.00/include/pstoedit/pstoedit.h:105:48: error: unkno
wn type name ‘std’; did you mean ‘stdin’?
  105 | void loadpstoeditplugins(const char* progname, std::ostream & errstream, bool verbose);
      |                                                ^~~
      |                                                stdin
src/output-pstoedit.c: In function ‘install_output_pstoedit_writers’:

Looks like the #ifdef are wrong for guarding the C++ sections?

Apteryks commented 9 months ago

Clarification: the above error appears to be during the build of autotrace; pstoedit builds fine itself.

reviczky commented 6 months ago

Wolfgang Glunz - 2024-03-28 fixed in 4.01

https://sourceforge.net/p/pstoedit/bugs/33/ https://sourceforge.net/p/pstoedit/patches/5/