Subject: Re: problems with String.h
From: [email-masked] (James Paul Morgan)

8 Apr 1997 00:21:04 -0700
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Original-To: [email-masked]
In-Reply-To: <[email-masked]>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Original-Sender: [email-masked]

The g++ with Cygnus gives priority to /include/g++ over the 
/H-i386../i386/include directory.  In fact, I had to rename a .h file in 
the latter directory becuase the /include/g++ was being used instead.

An undefined reference means your program referred to that but there is 
no definition for it.  In other words, String::String() does not exist in 
any of the linked files of libraries. 

I just compiled that code with:
g++ test.cpp -lg++

That worked fine.  You just need to link against the g++ library.

On Mon, 7 Apr 1997, DRS wrote:
> #include <strclass.h>
> #include <iostream.h>
> 
> main()
> {
> 	string str("This is a test.");
> 	cout << str << endl;
> 	return 0;
> 
> }
> 
> /*
> str.o(.text+0x35):str.cc: undefined reference to `String::String(char co
> str.o(.text+0x4b):str.cc: undefined reference to `operator<<(ostream &,
> onst &)'
> str.o(.text+0x66):str.cc: undefined reference to `String::~String(void)'
> */
> 

See ya around the Mulberry bush.

--James

:)

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".