- 论坛徽章:
- 0
|
最近刚装了RH 9.0,以前都没有用过
今天试试C++编译却出错了
文件名:ctest.cpp
#include <iostream.h>;
int main()
{
cout<<"yes"<<endl;
return 0;
}
# cc ctest.cpp
In file included from /usr/include/c++/3.2.2/backward/iostream.h:31,
from ctest.cpp:1:
/usr/include/c++/3.2.2/backward/backward_warning.h:32:2: warning: #warning This
file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples
include substituting the <X>; header for the <X.h>; header for C++ includes, or <sstream>; instead of the deprecated header <strstream.h>;. To disable this warning
use -Wno-deprecated.
/tmp/ccBmTp05.o(.text+0x14): In function `main':
: undefined reference to `std::basic_ostream<char, std::char_traits<char>; >;& std::endl<char, std::char_traits<char>; >;(std::basic_ostream<char, std::char_traits<char>; >;& '
/tmp/ccBmTp05.o(.text+0x21): In function `main':
: undefined reference to `std::cout'
/tmp/ccBmTp05.o(.text+0x26): 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/ccBmTp05.o(.text+0x2f): In function `main':
: undefined reference to `std::basic_ostream<char, std::char_traits<char>; >;: perator<<(std::basic_ostream<char, std::char_traits<char>; >;& (*)(std::basic_ostream<char, std::char_traits<char>; >;& )'
/tmp/ccBmTp05.o(.text+0x5c): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `std::ios_base::Init::Init[in-charge]()'
/tmp/ccBmTp05.o(.text+0x8b): In function `__tcf_0':
: undefined reference to `std::ios_base::Init::~Init [in-charge]()'
/tmp/ccBmTp05.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
这到底是怎么回事啊? |
|