| www.delorie.com/archives/browse.cgi | search |
| Xref: | news2.mv.net comp.os.msdos.djgpp:8138 |
| From: | "Maan M. Hamze" <mmhamze AT mail DOT utexas DOT edu> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: Problems with c++ library |
| Date: | 1 Sep 1996 05:52:09 GMT |
| Organization: | University of Texas at Austin |
| Lines: | 38 |
| Message-ID: | <01bb97c9$2d6c17e0$4dfb5380@maan-m.-hamze> |
| References: | <50ad0d$9ri AT newsbf02 DOT news DOT aol DOT com> |
| NNTP-Posting-Host: | slip-55-13.ots.utexas.edu |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
MIKEJAEKEL <mikejaekel AT aol DOT com> wrote in article
<50ad0d$9ri AT newsbf02 DOT news DOT aol DOT com>...
> #include <iostream.h>
> int main (void)
> {
> cout << "Here is the error.\n";
> return 0;
> }
>
> Here is the output:
> //test.cc(.text+0x22): undefined referenz to 'cout'
> //test.cc(.text+0x27): undefined referenz to 'ostream::operator<<char
> const *)'
>
What is the series of commands you are using?
First of all save your file with an extension of .C or .cc (say error.cc)
for C++.
Second:
compile with:
gcc -c -Wall error.cc
link with either:
a. gcc -o error.exe error.o -lgpp, or
b. gxx -o error.exe error.o
or compile and link with either:
a. gcc error.cc -o error.exe -lgpp, or
b. gxx error.cc -o error.exe
please note that I am using gcc along with -lgpp which links with the C++
lib (libgpp.a). Or I am using gxx which automatically looks for the C++
libs. Most probaby you are linking with gcc without inlcuding -lgpp. Thus
the errors you are seeing.
M
--
Maan M. Hamze
mmhamze AT mail DOT utexas DOT edu
http://leb.net/~mmhamze
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |