Титла: Problem s gcc Публикувано от: neznam в Aug 13, 2004, 18:35 Zdraveite ! V4era re6ih da so kompiliram edin prost cpp file s gcc. Zna4i source e :
Kogato go kompiliram s gcc ( gcc -o test test.cpp) mi izvejda slednite gre6ki: gcc -o test test.cpp In file included from /usr/include/c++/3.2.3/backward/iostream.h:31, from test.cpp:1: /usr/include/c++/3.2.3/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/ccoxnuw2.o(.text+0x21): In function `main': : undefined reference to `std::cout' /tmp/ccoxnuw2.o(.text+0x26): In function `main': : 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*)' /tmp/ccoxnuw2.o(.text+0x2f): In function `main': : 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*)' /tmp/ccoxnuw2.o(.text+0x5c): In function `tcf_0': : undefined reference to `std::ios_base::Init::~Init [in-charge]()' /tmp/ccoxnuw2.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0' collect2: ld returned 1 exit status Kak da se spravq s problema ? Титла: Problem s gcc Публикувано от: Hapkoc в Aug 13, 2004, 19:01 Здравей.
Има няколко неща относно въпроса ти: 1. Пробвай да компилираш с
2. В C++ се include-ва header без ".h", t.e.:
Така няма да ти дава този warning в началото 3. По принцип е добре (незнам дали е задължително) да укажеш namespace-а
или така
Това горе долу Не съм голям разбирач на C++, ако съм казал някоя глупост не ми се сърдете, а ме поправете по-добре Айде и поздрави Титла: Problem s gcc Публикувано от: neznam в Aug 14, 2004, 10:44 Ooo 10x man . Do sega ne bqh pisal na C++ pod linux.
|