Bug 92366 - compiling a gtk/gnome application with #include <iostream> causes libintl.h parse errors
Summary: compiling a gtk/gnome application with #include <iostream> causes libintl.h p...
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gnome-libs
Version: 9
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Havoc Pennington
QA Contact: Brian Brock
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-06-05 15:03 UTC by H. Carter
Modified: 2007-04-18 16:54 UTC (History)
0 users

(edit)
Clone Of:
(edit)
Last Closed: 2003-08-06 20:59:18 UTC


Attachments (Terms of Use)

Description H. Carter 2003-06-05 15:03:15 UTC
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):


How reproducible:
Sometimes

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

Additional info:

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

Comment 1 Jakub Jelinek 2003-06-17 18:07:08 UTC
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.

Comment 2 Havoc Pennington 2003-08-06 20:59:18 UTC
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 
keep working.

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.


Note You need to log in before you can comment on or make changes to this bug.