| delorie.com/archives/browse.cgi | search |
| Xref: | news2.mv.net comp.os.msdos.djgpp:2988 |
| From: | m9501470 AT cse DOT rmit DOT EDU DOT AU (Louie Lui) |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Can't compile C++ program with gcc |
| Date: | 23 Apr 1996 05:00:25 GMT |
| Organization: | Royal Melbourne Institute of Technology, Melbourne, Australia. |
| Lines: | 25 |
| Message-ID: | <4lho59$m2g@aggedor.rmit.EDU.AU> |
| NNTP-Posting-Host: | quoll.co.rmit.edu.au |
| Summary: | compile c++ with gcc |
| Keywords: | compile c++ |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
#include <iostream.h>
main()
{
cout << "hello, world." << endl;
return 0;
}
I've currently download a DGJPP C++ 2.7.2 compiler and installed the package
according to the instruction, when I compiled the above program with
gcc -Wall -o try try.cc
or
cc1plus -Wall -o try try.cc
I have obtained the following errors:
try.cc(.text+0x1a): undefined reference to `endl(ostream &)'
try.cc(.text+0x24): undefined reference to `cout'
try.cc(.text+0x29): undefined reference to `ostream::operator<<(char const *)'
try.cc(.text+0x34): undefined reference to `ostream::operator<<(ostream &(*)(ostream &))'
Can anyone suggest what do I need to do to get rid of above errors. Thanks in
advance.
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |