|
//////////test.cpp
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!\n";
}
slackware@linux:~/test$gcc test.cpp -o test
/tmp/cc7wDNwy.o(.text+0x19): In function `main':
: undefined reference to `std::cout'
/tmp/cc7wDNwy.o(.text+0x1e): In function `main':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std
:perator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits
<char> >&, char const*)'
/tmp/cc7wDNwy.o(.text+0x4a): In function `__static_initialization_and_destructio
n_0(int, int)':
: undefined reference to `std::ios_base::Init::Init[in-charge]()'
/tmp/cc7wDNwy.o(.text+0x79): In function `__tcf_0':
: undefined reference to `std::ios_base::Init::~Init [in-charge]()'
/tmp/cc7wDNwy.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
这个都不知道是那里错了. |
|