Дикс
26.06.2009, 12:44
поставил в дебиан 4 gcc и g++
написал простой код:
#include <iostream>
using namespace std;
int main()
{
cout << "test";
return 1;
}
не компилируется:
deex@debian:~$ gcc -o ./file ./new.cpp
/tmp/cc6PLgCa.o: In function `__static_initialization_and_destruction_0(int, int)':
new.cpp:(.text+0x23): undefined reference to `std::ios_base::Init::Init()'
/tmp/cc6PLgCa.o: In function `__tcf_0':
new.cpp:(.text+0x6c): undefined reference to `std::ios_base::Init::~Init()'
/tmp/cc6PLgCa.o: In function `main':
new.cpp:(.text+0x8e): undefined reference to `std::cout'
new.cpp:(.text+0x93): 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/cc6PLgCa.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
почему? :confused:
написал простой код:
#include <iostream>
using namespace std;
int main()
{
cout << "test";
return 1;
}
не компилируется:
deex@debian:~$ gcc -o ./file ./new.cpp
/tmp/cc6PLgCa.o: In function `__static_initialization_and_destruction_0(int, int)':
new.cpp:(.text+0x23): undefined reference to `std::ios_base::Init::Init()'
/tmp/cc6PLgCa.o: In function `__tcf_0':
new.cpp:(.text+0x6c): undefined reference to `std::ios_base::Init::~Init()'
/tmp/cc6PLgCa.o: In function `main':
new.cpp:(.text+0x8e): undefined reference to `std::cout'
new.cpp:(.text+0x93): 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/cc6PLgCa.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
почему? :confused: