Red Hat Bugzilla – Bug 92366
compiling a gtk/gnome application with #include <iostream> causes libintl.h parse errors
Last modified: 2007-04-18 12:54:19 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
Description of problem:
compiling a gtk/gnome application with #include <iostream> causes libintl.h
parse errors....believe this has to do with the fact that gnome.h is also
included. Possible gettext () problem?
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.Create gtk/gnome application.
2.Include iostream header
3.use g++ to compile--should see libintl.h:40 parse error before `const`
Actual Results: can't create .o file
Expected Results: Should've created the .o file
Must have gnome.h and iostream.h included. It appears to have something to do
with how they are ordered. After much re-ordering,
if I include gnome.h, then <gtk/gtk.h> , then <iostream> I had a successful
compile without the odd libintl.h error....there is a macro somewhere that is
unset or set when these are in the wrong order....
This has zilch to do with gcc.
Unless you compile with -DENABLE_NLS, gnome.h among other things
#define gettext(String) (String)
which is what breaks libintl.h.
I really thing you should include standard headers first (whether C or C++ ones)
and then the rest.
I can't think of a fix for this that wouldn't potentially cause a similar
problem for someone else. e.g. we could not #define gettext but that
is a source incompatible change.
gnome-libs 1.x is long obsolete and so making changes doesn't really
make sense; it should just stay absolutely unchanging so people's workarounds
If the problem is still in libgnome 2.x we can ask upstream to modify the
API, but honestly my suggestion is to stick to plain GTK 2.