Hi,

I ran into some trouble with <string> when compiling on RH 7.1.

It seems that on this platform, configure decides that it is OK to use 
<sstream>, but that it is not OK to use <string>. 

Subsequently, in formula.C, <sstream> is indirectly included before 
"LString.h", thereby including <string> as well, causing the #error in 
"LString.h" to be broken.

I think that <sstream> should not be used when <string> is not being used. 
The simplest way I could find to fix this is to change the macro which 
selects between <sstream> and "Lsstream.h" to only use <sstream> when 
<string> is being used as well. A patch which enforces this is attached.

I think that the autoconf macro which is used to detect sstream is broken as 
well - it wasn't detecting sstream on RH <= 7.0 when it was actually there, 
but I haven't done anything about this as everything compiled OK.

Ben.

-- 
Ben Stanley               |    barf  [ba:rf]  2.  "He suggested using FORTRAN,
PhD Student               |       and everybody barfed." - From the 
Shogakukan 
SITACS                    |       DICTIONARY OF NEW ENGLISH (Second Edition)
University of Wollongong  |       
Australia                 |    http://www.uow.edu.au/~bds02

diff -rc lyx-1.1.6fix1/src/Lsstream.h lyx-1.1.6fix1-changed/src/Lsstream.h
*** src/Lsstream.h.orig         Fri Sep 15 23:08:06 2000
--- src/Lsstream.h          Fri May 11 19:36:13 2001
***************
*** 12,19 ****
  #ifndef LSSTREAM_H
  #define LSSTREAM_H 
  
! #ifdef HAVE_SSTREAM
  #include <sstream>
  #else
  #include "support/sstream.h"
  #endif
--- 12,20 ----
  #ifndef LSSTREAM_H
  #define LSSTREAM_H 
  
! // 20010511 bstanley should not use <sstream> if we are not using <string>.
! #if defined( HAVE_SSTREAM ) && !defined( USE_INCLUDED_STRING )
  #include <sstream>
  #else
  #include "support/sstream.h"
  #endif

Reply via email to