Mail Archives: djgpp/1995/12/22/17:04:20
Xref: | news-dnh.mv.net comp.os.msdos.djgpp:4002
|
Path: | news-dnh.mv.net!mv!barney.gvi.net!news.netrail.net!imci2!newsfeed.internetmci.com!swrinde!howland.reston.ans.net!vixen.cso.uiuc.edu!cs.uiuc.edu!kamin
|
From: | kamin AT cs DOT uiuc DOT edu (Sam Kamin)
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: Baffling compilation errors
|
Date: | 22 Dec 1995 18:26:54 GMT
|
Organization: | University of Illinois, Dept of Computer Science
|
Lines: | 38
|
Distribution: | world
|
Message-ID: | <4bet9e$dtu@vixen.cso.uiuc.edu>
|
References: | <4aumi5$va AT kirin DOT wwa DOT com>
|
NNTP-Posting-Host: | kamin.cs.uiuc.edu
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
In article <4aumi5$va AT kirin DOT wwa DOT com>, car AT wwa DOT com (Chris A. Rodgers) writes:
|> Hi, all! I am having trouble compiling c++ source after reinstalling
|> my system. To show the error, I chose a simple old example.
|>
|> I have djgpp installed in e:\djgpp. I am passing the compilation
|> parameter -lgpp, but I am getting unresolvced references of cin and
|> cout. I am sure I am just missing something basic, but I went over
|> the steps in the faq and everything still seems to be in order, but
|> not working. Any suggestions? (email or news is fine)
|>
|> code:------------------------------------------
|> // myfirst.cpp--displays a message
|> #include <iostream.h> // a PREPROCESSOR directive
|> int main(void)
|> {
|> cout << "Come up and C++ me some time.";
|> cout << "\n";
|> return 0;
|> }
|>
|> compile error messages:-----------------------------
|> E:\DJGPP\SRC\cis_230\testbed1>gcc -v -lgpp myfirst.cpp -o myfirst
....
|> myfirst.cc(.text+0x2e): undefined reference to `cout'
|> myfirst.cc(.text+0x33): undefined reference to
|> `ostream::operator<<(char const *
|> )'
|> myfirst.cc(.text+0x40): undefined reference to `cout'
|> myfirst.cc(.text+0x45): undefined reference to
|> `ostream::operator<<(char const *
|> )'
I fixed this problem by using
gcc ... -liostr
- Sam Kamin
Univ. of Illinois
- Raw text -