delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/18/00:52:05

Message-ID: <19990518045020.62062.qmail@hotmail.com>
X-Originating-IP: [198.68.22.59]
From: "Paul H" <paulwebdev AT hotmail DOT com>
To: djgpp AT delorie DOT com
Subject: _String.h Error in compiling C++ program
Date: Mon, 17 May 1999 21:50:13 PDT
Mime-Version: 1.0
Reply-To: djgpp AT delorie DOT com

Hello,

2 Things:

  When I compile the following program:

#include <iostream.h>
#include <iomanip.h>
#include <_String.h>

int main () {
   String abc;
   abc = "test";
   cout << abc;

   return 0;
}

I get the following results with gxx:

C:\Development\c>gxx -o test.ext test.o
test.o(.text+0x1f):test.cpp: undefined reference to `String::String(void)'
test.o(.text+0x30):test.cpp: undefined reference to `String::operator=(char 
cons
t *)'
test.o(.text+0x43):test.cpp: undefined reference to `operator<<(ostream &, 
Strin
g const &)'
test.o(.text+0x53):test.cpp: undefined reference to `String::~String(void)'
test.o(.text+0x7b):test.cpp: undefined reference to `String::~String(void)'

What am I doing wrong?

Furthermore, I was searching you archives, and I say a problem identical to 
mine.  I tried, but I couldn't find the responses to the question.  Mine 
would have been answered had I seen those responses.

Thanks,

Paul Hand
paulwebdev AT hotmail DOT com





_______________________________________________________________
Get Free Email and Do More On The Web. Visit http://www.msn.com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019