Bug 18166

Summary: libstc++ compile errors
Product: [Retired] Red Hat Linux Reporter: James Boulton <james.boulton>
Component: libstdc++Assignee: Jakub Jelinek <jakub>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-01 15:47:30 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 James Boulton 2000-10-03 02:02:46 UTC
When I tried to compile lyx-1.1.5pre3 under a new install of RH7 I get the
following errors.
There appears to be syntax errors in the libstc++ headers
----------------
make[3]: Entering directory `/root/lyx-1.1.5pre3/src/mathed'
/bin/sh ../../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I.
-I../../src -I.
./../images -I./../   -I/usr/X11R6/include  -g -O -fhonor-std -W -Wall
-Wconvers
ion -Winline -c formula.C
g++ -DHAVE_CONFIG_H -I. -I. -I../../src -I../../images -I./../
-I/usr/X11R6/incl
ude -g -O -fhonor-std -W -Wall -Wconversion -Winline -c formula.C -o
formula.o
In file included from /usr/include/g++-3/cstddef:7,
                 from /usr/include/g++-3/std/bastring.h:36,
                 from /usr/include/g++-3/string:7,
                 from /usr/include/g++-3/sstream:31,
                 from formula.C:20:
/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stddef.h:147: syntax error
befor
e `typedef'
In file included from /usr/include/g++-3/alloc.h:22,
                 from /usr/include/g++-3/std/bastring.h:40,
                 from /usr/include/g++-3/string:7,
                 from /usr/include/g++-3/sstream:31,
                 from formula.C:20:
/usr/include/g++-3/stl_alloc.h:733: parse error before `;'
/usr/include/g++-3/stl_alloc.h:773: parse error before `;'
/usr/include/g++-3/stl_alloc.h:808: parse error before `;'
/usr/include/g++-3/stl_alloc.h:851: parse error before `;'
In file included from /usr/include/g++-3/iterator:39,
                 from /usr/include/g++-3/std/bastring.h:45,
                 from /usr/include/g++-3/string:7,
                 from /usr/include/g++-3/sstream:31,
                 from formula.C:20:
/usr/include/g++-3/stl_iterator.h:88: parse error before `,'
/usr/include/g++-3/stl_iterator.h:92: template declaration of `typedef 
_Tp value_type'
/usr/include/g++-3/stl_iterator.h:92: Internal error: Segmentation 
fault.
Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
make[3]: *** [formula.lo] Error 1
make[3]: Leaving directory `/root/lyx-1.1.5pre3/src/mathed'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/lyx-1.1.5pre3/src'
make[1]: *** [all-recursive-am] Error 2
make[1]: Leaving directory `/root/lyx-1.1.5pre3/src'
make: *** [all-recursive] Error 1
---------------------


James Boulton

Comment 1 Jakub Jelinek 2000-10-03 10:37:34 UTC
Ok, from current investigation it looks like it is partly bug on lyx side and
maybe there is some bug in libstdc++, will need to investigate more.
The bug on lyx side is that it assumes gcc 2.96 means libstdc++-v3 which is
wrong assumption (even current CVS gcc 2.97 does not build libstdc++-v3
by default), changing aclocal.m4 and configure so that on 2.96) it does the
same as with 2.95.*) cures it.
Another problem is that in 2.96 libstdc++ there is sstream header, but probably
not the one lyx assumes to see (again I think it thinks it must be from
libstdc++-v3). Commenting #define HAVE_SSTREAM 1 out of src/config.h after
configure or taking it out of configure.in/configure makes lyx to compile
on RHL7.
I'll ask the C++ folks whether using -fhonor-std with libstdc++-v2 headers
is actually allowed, whether <sstream> is allowed to include <string> (that is
one reason why formula.C fails because lyxstring.h defines its own string class
which conflicts with the one defined in <string> and whether sstream should
be compilable with -fno-rtti or not (that is the other reason).

Comment 2 Jakub Jelinek 2000-10-11 09:21:00 UTC
*** Bug 18739 has been marked as a duplicate of this bug. ***

Comment 3 Need Real Name 2000-10-19 20:13:48 UTC
*** Bug 19068 has been marked as a duplicate of this bug. ***

Comment 4 Benjamin Kosnik 2004-10-01 15:47:30 UTC
> lyxstring.h defines its own string class
>which conflicts with the one defined in <string> 

Bug.

with gcc-2.x compilers, without namespace support, this is a violation
of ODR.

-benjamin