User forums > Using Code::Blocks
#include "glee.h" error: you need ISO C conforming compiler to use glibc headers
bootstrap:
I have been developing a portable 3D game/graphics/simulation engine that runs on linux and windoze for some time, with the eclipse IDE in linux, and VisualStudio2005 in windoze. Recently I got so frustrated with eclipse that I went looking for alternatives and found CodeBlocks. To get up to speed, I tried to get a somewhat smaller project to compile and run, and with a little help from this forum, was successful. What a relief to be able to ditch eclipse! :-)
Then I tried to compile my 3D engine, but ran into an error that I am not smart enough to "make go away". I find it a bit confusing, since eclipse is also running the same compiler (or at least both IDEs *say* the compiler is GCC), and as far as I can tell, all my settings are the same. I have found that when I comment out the #include "glee.h" statement the problem I describe below goes away, but of course all the OpenGL functions generates errors (because the OpenGL functions are not defined).
The problem is this (when the #include "glee.h" is in the code). It compiles a bunch of my files, then hits an error and stops. The error it hits is in the "/usr/include/sys/cdefs.h" file on line 32, and the error message is "error: you need a ISO C conforming compiler to use glibc headers". The following is the line where the error occurs (the middle line). My program does not define either __GNUC__ or __STDC__, and apparently neither does the "glee.h" file - at least not directly (in the text of the "glee.h" file).
#if defined __GNUC__ && !defined __STDC__
# error "You need a ISO C conforming compiler to use the glibc headers"
#endif
In my eclipse version, I have two compiler switches defined, -traditional-cpp and -funsigned-char. I try removing them, but that doesn't change this problem. The only defines I have set in the CodeBlocks "build options" are two of my own, namely CPU32 and LINUX. What am I missing? I searched around the internet for an answer, but found nothing helpful. Any ideas?
Ceniza:
I guess there must be an option in Eclipse to show the full command line being used to compile your files. C::B has such an option for sure. You could try comparing both command lines for the same file. There's a chance Eclipse adds a few more things to it, so it would be just a matter of adding those missing options to your project in C::B.
MortenMacFly:
--- Quote from: bootstrap on January 22, 2009, 07:29:57 am ---In my eclipse version,
--- End quote ---
There is a nice plugin for Eclipse that allows exporting Eclipse projects to C::B. This is done by mariocup (search the forums accordingly...). You could try that one, too.
thomas:
--- Quote ---There's a chance Eclipse adds a few more things to it, so it would be just a matter of adding those missing options to your project in C::B.
--- End quote ---
You probably have added too many compiler options, some of which you haven't understood, because:
H:\>cpp -dM nul |grep STDC
#define __STDC_HOSTED__ 1
#define __STDC__ 1
If you don't do anything, __STDC__ is defined.
In general, apart from include directories, most programs should need few if any options to compile.
mariocup:
Hi Martin,
we are still working at the Eclipse to CB exporter and we will also fix add missing features reported from you.
I think a first version will be available in the middle of March. :D
Bye,
Mario
Navigation
[0] Message Index
[#] Next page
Go to full version