Article View: gnu.gcc.help
Article #917Re: how can i tell if my new c++ compiler is working?
From: Michael Bresnahan
Date: Tue, 05 Sep 1995 06:07
Date: Tue, 05 Sep 1995 06:07
39 lines
1314 bytes
1314 bytes
The errors you got do just pretain to C++. They pertain to any language
that uses a linker (I think). The problem is that you made references to
functions you didn't define. You _declared_ them in your header file,
but you didn't link in a module where they are defined.
You another file something like this:
String.cc:
#include "String.h"
String::set_to( char *s) {
strcpy( text, s);
}
String::length() {
return strlen( text);
}
String::read() {
return text;
}
String::print() {
cout << text;
}
You need to compile this file and link it with your program. An
easy way to do this is:
g++ my_prog.c String.c -o my_prog
Hope this helps.
MikeB
Technical Details
Message-ID:
<42gper$aha@blackice.winternet.com>Path:
arc1-ca.pugleaf.net!winternet.com!newsReferences:
<42fktm$g2p@news.acns.nwu.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!winternet.com!news From: Michael Bresnahan <gudu@winternet.com> Newsgroups: gnu.gcc.help,comp.lang.c++,comp.unix.programmer Subject: Re: how can i tell if my new c++ compiler is working? Date: 5 Sep 1995 06:07:23 GMT Organization: Bouncing Fried Hairy Bleefjuice Message-ID: <42gper$aha@blackice.winternet.com> References: <42fktm$g2p@news.acns.nwu.edu> NNTP-Posting-Host: gudu.winternet.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 1.1N (X11; I; Linux 1.2.8 i586) X-URL: news:42fktm$g2p@news.acns.nwu.edu