|
我的系统是fedora,我用gedit编了一个c++源文件,保存为hhh.cxx,但我在终端下用gcc编译不出可执行文件呀?
这是我编的:
#include <iostream.h>
main()
{
cout<<"hello!"<<endl;
}
------------------------------------------------------------------------
[jinke@fedora jinke]$ gcc -o wo hhh.cxx
In file included from /usr/include/c++/3.3.2/backward/iostream.h:31,
from hhh.cxx:1:
/usr/include/c++/3.3.2/backward/backward_warning.h:32:2: warning: #warning This
file includes at least one deprecated or antiquated header. Please consider usin
g 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 <s
stream> instead of the deprecated header <strstream.h>. To disable this warning
use -Wno-deprecated.
/tmp/ccDGqQIh.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/ccDGqQIh.o(.text+0x21): In function `main':
: undefined reference to `std::cout'
/tmp/ccDGqQIh.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/ccDGqQIh.o(.text+0x2f): In function `main':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >:pe rator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostrea m<char, std::char_traits<char> >&))'
/tmp/ccDGqQIh.o(.text+0x5c): In function `__static_initialization_and_destructio n_0(int, int)':
: undefined reference to `std::ios_base::Init::Init[in-charge]()'
/tmp/ccDGqQIh.o(.text+0x8b): In function `__tcf_0':
: undefined reference to `std::ios_base::Init::~Init [in-charge]()'
/tmp/ccDGqQIh.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status |
|