[TriLUG] OT: String.h in g++ around Redhat 5.0

Guthrie, Joshua L CIV NAVAIRDEPOT joshua.guthrie at navy.mil
Fri Jun 16 12:27:50 EDT 2006


You've said what I was afraid I'd probably hear.

It works great on a new complier.  However, I'm stuck using this old
one.  The code was to be integrated into the code of a production
machine (was just going to rename main() to somethingElse()).  It is the
front end of a mission critical test and measurement setup.  I am
horrified about the idea of updating the compiler and recompile the old
application.  In short, the reasons why I have to use the older compiler
would fill many pages of ranting (let alone why we are still using
Redhat 5.0).

I've just made the mistake of assuming the compilers hadn't changed all
that much (besides, I'm not really doing much of anything fancy).

Looks like my best bet is to rewrite the program to not use the 'string'
data type.  Oh well.

Thanks for the response
-josh

			Date: Fri, 16 Jun 2006 10:05:30 -0400
			From: Owen Berry <oberry at trilug.org>
			Subject: Re: [TriLUG] OT:  String.h in g++
around Redhat 5.0
			To: Triangle Linux Users Group discussion list
<trilug at trilug.org>
			Message-ID:
<20060616140530.GA15984 at mail.trilug.org>
			Content-Type: text/plain; charset=us-ascii

			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?

			Owen



					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
					> #includes...
					> 
					> 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 '...'
					> 	And 
					> 	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!!
					> 
					> 
					> 	-josh
					> 






More information about the TriLUG mailing list