Compiling in Centos 6 fails

Issue #110 resolved
Former user created an issue

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)

  1. Chris Reuter

    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.)

  2. Log in to comment