lumingzuiku
April 4th, 2006, 07:43 AM
My source code is faily simple as below:
#include<iostream>
using namespace std;
int main(void)
{
cout<<"Hello World!"<<endl;
return 0;
}
But compiler gave me some error messages like this:
/tmp/ccNfUm8H.o: In function `main':
1.cpp:(.text+0x25): undefined reference to `std::cout'
1.cpp:(.text+0x2a): 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*)'
...........
I used cpp to compile my code, is it the right thing to compile C++ files?
thx a lot!
#include<iostream>
using namespace std;
int main(void)
{
cout<<"Hello World!"<<endl;
return 0;
}
But compiler gave me some error messages like this:
/tmp/ccNfUm8H.o: In function `main':
1.cpp:(.text+0x25): undefined reference to `std::cout'
1.cpp:(.text+0x2a): 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*)'
...........
I used cpp to compile my code, is it the right thing to compile C++ files?
thx a lot!