Mistake With CPP File
SoloCDM <[email protected]>
| Newsgroups | org.kernel.vger.linux-gcc |
|---|---|
| Message-ID | <[email protected]> |
Recently I tried to compile fig01_02.cpp with Kernel 2.2.20 on Linux
Mandrake 8.0. I used "gcc fig01_02.cpp" and received the following
errors:
<user_account>/tmp/ccmeDWKS.o: In function `main':
<user_account>/tmp/ccmeDWKS.o(.text+0xf): undefined reference to
`cout'
<user_account>/tmp/ccmeDWKS.o(.text+0x14): undefined reference to
`ostream::operator<<(char const *)'collect2: ld returned 1 exit status
Why didn't it work?
I attached the file in question.
--
Note: When you reply to this message, please include the mailing
list/newsgroup address and my email address in To:.
*********************************************************************
Signed,
SoloCDM
fig01_02.cpp
(text/plain, 178 B)
// Fig. 1.2: fig01_02.cpp
// A first program in C++
#include <iostream.h>
int main()
{
cout << "Welcome to C++!\n";
return 0; // indicate that program ended successfully
}