[TriLUG] OT: String.h in g++ around Redhat 5.0
oberry at trilug.org
Fri Jun 16 10:05:30 EDT 2006
The problems you are experiencing all seem related to the C++ Standard
Library. If you're getting warnings about namespaces being mostly broken
in this version of the compiler, I would expect serious headaches as
namespace support is a requirement for the standard library (it's all in
std). Many other things may not be working as expected if something as
basic as this is "mostly broken".
Of course, I may be wrong and the libraries you're having trouble with
aren't from the C++ Standard Library ... because the library wasn't
standardized yet. (??) When was this compiler released? According to my
Josuttis book (The C++ Standard Library) the C++ standard was worked on
between 1989 and 1997/98. In this case, you might still have headaches
figuring out how it should work, because C++ wasn't standardized when
your compiler came out, unless you can find some old documentation.
My suggestion would be to look at using a newer compiler. If you're
stuck with the older compiler, I would look at using standard C. Just my
HO. BTW, why are you trying to get this to work on the older compiler?
On Fri, Jun 16, 2006 at 07:46:46AM -0400, Guthrie, Joshua L CIV NAVAIRDEPOT wrote:
> This that stood out for me having to do was to put .h's behing the
> using std::iso;
> using namespace std;
> gave me the reassuring warning:
> Warning: namespaces are mostly broken in this version of G++
> So I commented them out..
> I complile and get a crap load of warning:
> Cannot pass objects of type 'ifstream' through '...'
> Cannot pass objects of type 'String' through '...'
> The compiler didn't like me declaring string but seemed to like
> String better... so I replaced my string (s) with String...
> I get errors:
> No member function 'String::find(char)' defined
> No member function 'String::erase(int, unsigned int)' defined
> No member function 'String::c_str()' defined
> These seem to be on lines that I use the data type String...
> My namespace warning, and my inability to find a sstream.h, or
> get String to work started to make me wonder if I had slipped into a
> twilight zone of comiler history in linux...
> Sorry for the long post :-(
> And thanks!!
More information about the TriLUG