brast
01-26-2003, 12:43 PM
I've recently installed glibc2.3 on my computer, I originally had a prior version, however, I cannot compile a simple C++ program. Not to imply that I could before, because I couldn't, I got an error I thought was due to an antiquated C library. But now I have all new errors.
Here's the coding to the "helloworld.cpp":
_____________________________________
#include <iostream.h>
int main()
{
cout << "Hello World!\n";
return 0;
}
_____________________________________
Here's the error message:
_____________________________________
[brast@localhost brast]$ gcc ./C/helloworld.cpp
In file included from /usr/include/c++/3.2/backward/iostream.h:31,
from C/helloworld.cpp:1:
/usr/includec++/'3.2/backward/backward_warning.h
<<<<It gives info on the whole deprecated header thing. >>>>>
C/helloworld.cpp:6:2: warning: no newline at end of file
/tmp/ccteWuLA.o: In function `main':
/tmp/ccteWuLA.o(.text+0x19): undefined reference to `std::cout'
/tmp/ccteWuLA.o(.text+0x1e): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
<<<<and it continues on like that for a while until it goes>>>>
collect2: ld returned 1 exit status
[brast@localhost brast]$
Any help is appreciated.
Here's the coding to the "helloworld.cpp":
_____________________________________
#include <iostream.h>
int main()
{
cout << "Hello World!\n";
return 0;
}
_____________________________________
Here's the error message:
_____________________________________
[brast@localhost brast]$ gcc ./C/helloworld.cpp
In file included from /usr/include/c++/3.2/backward/iostream.h:31,
from C/helloworld.cpp:1:
/usr/includec++/'3.2/backward/backward_warning.h
<<<<It gives info on the whole deprecated header thing. >>>>>
C/helloworld.cpp:6:2: warning: no newline at end of file
/tmp/ccteWuLA.o: In function `main':
/tmp/ccteWuLA.o(.text+0x19): undefined reference to `std::cout'
/tmp/ccteWuLA.o(.text+0x1e): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
<<<<and it continues on like that for a while until it goes>>>>
collect2: ld returned 1 exit status
[brast@localhost brast]$
Any help is appreciated.