Bug 92366

Summary: compiling a gtk/gnome application with #include <iostream> causes libintl.h parse errors
Product: [Retired] Red Hat Linux Reporter: H. Carter <heather_a_carter>
Component: gnome-libsAssignee: Havoc Pennington <hp>
Status: CLOSED WONTFIX QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-08-06 20:59:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.