Nie kompiluje się pod Linuxem.
Panel użytkownika
Nazwa użytkownika:
Hasło:
Nie masz jeszcze konta?
Zarejestruj się!

Nie kompiluje się pod Linuxem.

AutorWiadomość
Temat założony przez niniejszego użytkownika
Nie kompiluje się pod Linuxem.
» 2014-11-30 16:38:06
Witam wszystkich.
Potrzebuje pomocy, mianowicie mój program pięknie działa pod Windowsem, ale niestety nie kompiluje się pod Linuxem.
Błąd: collect2: error: ld returned 1 exit status


Logi:


/tmp/ccEH8YLL.o: In function `main':
main.cpp:(.text+0x301): undefined reference to `std::cout'
main.cpp:(.text+0x306): 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*)'
main.cpp:(.text+0x313): 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*)'
main.cpp:(.text+0x31e): undefined reference to `std::ostream::operator<<(int)'
main.cpp:(.text+0x32b): 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*)'
main.cpp:(.text+0x335): undefined reference to `std::ostream::operator<<(int)'
main.cpp:(.text+0x33a): 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> >&)'
main.cpp:(.text+0x342): undefined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))'
main.cpp:(.text+0x347): 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> >&)'
main.cpp:(.text+0x34f): undefined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))'
/tmp/ccEH8YLL.o: In function `__static_initialization_and_destruction_0(int, int)':
main.cpp:(.text+0x79c): undefined reference to `std::ios_base::Init::Init()'
main.cpp:(.text+0x7ab): undefined reference to `std::ios_base::Init::~Init()'
/tmp/ccEH8YLL.o: In function `Ring<int, int>::print() const':
main.cpp:(.text._ZNK4RingIiiE5printEv[_ZNK4RingIiiE5printEv]+0x2e): undefined reference to `std::cout'
main.cpp:(.text._ZNK4RingIiiE5printEv[_ZNK4RingIiiE5printEv]+0x33): 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*)'
main.cpp:(.text._ZNK4RingIiiE5printEv[_ZNK4RingIiiE5printEv]+0x38): 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> >&)'
main.cpp:(.text._ZNK4RingIiiE5printEv[_ZNK4RingIiiE5printEv]+0x40): undefined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))'
main.cpp:(.text._ZNK4RingIiiE5printEv[_ZNK4RingIiiE5printEv]+0x45): 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> >&)'
main.cpp:(.text._ZNK4RingIiiE5printEv[_ZNK4RingIiiE5printEv]+0x4d): undefined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))'
main.cpp:(.text._ZNK4RingIiiE5printEv[_ZNK4RingIiiE5printEv]+0x66): undefined reference to `std::cout'
main.cpp:(.text._ZNK4RingIiiE5printEv[_ZNK4RingIiiE5printEv]+0x6b): undefined reference to `std::ostream::operator<<(int)'
main.cpp:(.text._ZNK4RingIiiE5printEv[_ZNK4RingIiiE5printEv]+0x78): 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*)'
main.cpp:(.text._ZNK4RingIiiE5printEv[_ZNK4RingIiiE5printEv]+0x82): undefined reference to `std::ostream::operator<<(int)'
main.cpp:(.text._ZNK4RingIiiE5printEv[_ZNK4RingIiiE5printEv]+0x8f): 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*)'
main.cpp:(.text._ZNK4RingIiiE5printEv[_ZNK4RingIiiE5printEv]+0xc0): 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> >&)'
main.cpp:(.text._ZNK4RingIiiE5printEv[_ZNK4RingIiiE5printEv]+0xc5): undefined reference to `std::cout'
main.cpp:(.text._ZNK4RingIiiE5printEv[_ZNK4RingIiiE5printEv]+0xca): undefined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))'
main.cpp:(.text._ZNK4RingIiiE5printEv[_ZNK4RingIiiE5printEv]+0xd7): 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*)'
main.cpp:(.text._ZNK4RingIiiE5printEv[_ZNK4RingIiiE5printEv]+0xe1): undefined reference to `std::ostream::operator<<(unsigned int)'
main.cpp:(.text._ZNK4RingIiiE5printEv[_ZNK4RingIiiE5printEv]+0xe6): 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> >&)'
main.cpp:(.text._ZNK4RingIiiE5printEv[_ZNK4RingIiiE5printEv]+0xee): undefined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))'
main.cpp:(.text._ZNK4RingIiiE5printEv[_ZNK4RingIiiE5printEv]+0xf3): 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> >&)'
main.cpp:(.text._ZNK4RingIiiE5printEv[_ZNK4RingIiiE5printEv]+0xfb): undefined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))'
/tmp/ccEH8YLL.o: In function `Ring<int, int>::push(int const&, int const&)':
main.cpp:(.text._ZN4RingIiiE4pushERKiS2_[_ZN4RingIiiE4pushERKiS2_]+0x1a): undefined reference to `operator new(unsigned long)'
/tmp/ccEH8YLL.o: In function `Ring<int, int>::insert(int const&, int const&, Ring<int, int>::iterator&)':
main.cpp:(.text._ZN4RingIiiE6insertERKiS2_RNS0_8iteratorE[_ZN4RingIiiE6insertERKiS2_RNS0_8iteratorE]+0x6a): undefined reference to `operator new(unsigned long)'
/tmp/ccEH8YLL.o: In function `Ring<int, int>::remove(Ring<int, int>::iterator&)':
main.cpp:(.text._ZN4RingIiiE6removeERNS0_8iteratorE[_ZN4RingIiiE6removeERNS0_8iteratorE]+0x115): undefined reference to `operator delete(void*)'
/tmp/ccEH8YLL.o: In function `Ring<int, int>::clear()':
main.cpp:(.text._ZN4RingIiiE5clearEv[_ZN4RingIiiE5clearEv]+0x5b): undefined reference to `operator delete(void*)'
/tmp/ccEH8YLL.o:(.eh_frame+0x13): undefined reference to `__gxx_personality_v0'
collect2: error: ld returned 1 exit status

Bardzo proszę o pomoc, pozdrawiam.
P-121754
» 2014-11-30 20:31:26
Znalazłem podobny temat http://qt-project.org/forums/viewthread/42146
może pomoże
P-121772
Temat założony przez niniejszego użytkownika
» 2014-12-01 08:00:40
Niestety nie tutaj leży problem, ale dzięki. Ma ktoś jakieś pomysły?
P-121808
» 2014-12-01 08:29:24
w pierwszej linijce komunikatu błędu masz
undefined reference to `std::cout'
czyli nie widzi biblioteki std

jeśli kompilator jej nie widzi to musisz ją wskazać w skrypcie kopilacyjnym
lub wystarczy zrezygnować z std::count ma count w programie
+
using namespace std;

P-121810
» 2014-12-01 16:19:14
Jak to kompilujesz? Może zamiast polecenia g++ używasz gcc?
P-121837
Temat założony przez niniejszego użytkownika
» 2014-12-01 18:34:40
Pani Moniko, jest Pani wielka! Używałem oczywiście gcc i mi nie działało. Dziękuję pięknie. :)
P-121854
« 1 »
 Strona 1 z 1