PDA

View Full Version : GCC bool undefined



Stack Overflow
07-05-2004, 06:44 PM
Currently,

I'm using Redhat 9.0 with Kernel 2.4.20-31.9. Including GLIB 2.4, GLIBC 2.2 and GCC 3.2.2 20040222 (Red Hat Linux 3.2.2-5).

Whenever I compile a file with gcc, the identifier bool seems to be undeclared. I have temporarily fixed this by adding typedef enum {FALSE, TRUE} bool; to my main source file, but I would like to know if there is a patch for GCC that might fix this in the future. Or if one or more of my previous versions of GCC, GLIB, are GLIBC or out-dated and may have something to do with this problem, please let me know.


Thank you for your time,
- Stack Overflow

Ken Fitlike
07-05-2004, 07:04 PM
bool is a c++ type; use g++ or stick with your enum typedef if you want to use it with gcc.

Stack Overflow
07-05-2004, 07:06 PM
Okay,

Thanks for the tip. I'll keep this in mind.


Thank you for your time,
- Stack Overflow

linuxdude
07-06-2004, 12:54 PM
you might think it is because vi automatically highlights it even in .c code.