Bug 92366 - compiling a gtk/gnome application with #include <iostream> causes libintl.h parse errors
compiling a gtk/gnome application with #include <iostream> causes libintl.h p...
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: gnome-libs (Show other bugs)
9
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Havoc Pennington
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-06-05 11:03 EDT by H. Carter
Modified: 2007-04-18 12:54 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-08-06 16:59:18 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description H. Carter 2003-06-05 11:03:15 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):


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 14:07:08 EDT
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 16:59:18 EDT
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.