Compiling in Centos 6 fails
Issue #110
resolved
When trying to compile libgd in Centos 6.4 it fails with a message
gd_jpeg.c:228: error: ‘TRUE’ undeclared (first use in this function) gd_jpeg.c:228: error: (Each undeclared identifier is reported only once
Solution :
Edit gd_jpeg.c
replace all instances of TRUE with true replace all instances of FALSE with false
It compiles perfectly after that. Maybe it is worth incorporating in the source code itself.
Comments (3)
-
-
don't we have GD_TRUE/FALSE already?
-
- changed status to resolved
fixed in GD-2.1 and master
- Log in to comment
Really, they should be set to GD_TRUE and GD_FALSE respectively, since those are guaranteed to be defined in the GD source tree. TRUE and FALSE are defined (on my system--Ubuntu 13.04) in a JPEG lib header file.
Actually, this behaviour is kind of wierd. Are you sure it's being compiled with gcc and not g++? 'true' and 'false' are not keywords in C. (They are, however, defined as standard macros in stdbool.h.)