1
/tmp/ccloHU4h.o:dad.cpp:(.text+0x28): undefined reference to `___gxx_personality _sj0'
/tmp/ccloHU4h.o:dad.cpp:(.text+0x5c): undefined reference to `std::cout'
/tmp/ccloHU4h.o:dad.cpp:(.text+0x68): 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/ccloHU4h.o:dad.cpp:(.text+0x70): undefined reference to `std::basic_ostream <char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::b asic_ostream<char, std::char_traits<char> >&)'
/tmp/ccloHU4h.o:dad.cpp:(.text+0x78): undefined reference to `std::basic_ostream <char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_t raits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))'
/tmp/ccloHU4h.o:dad.cpp:(.text+0x86): undefined reference to `std::cin'
/tmp/ccloHU4h.o:dad.cpp:(.text+0x8b): undefined reference to `std::basic_istream <char, std::char_traits<char> >::operator>>(int&)'
/tmp/ccloHU4h.o:dad.cpp:(.text+0x9a): undefined reference to `std::cout'
/tmp/ccloHU4h.o:dad.cpp:(.text+0x9f): 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/ccloHU4h.o:dad.cpp:(.text+0xa7): undefined reference to `std::basic_ostream <char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::b asic_ostream<char, std::char_traits<char> >&)'
/tmp/ccloHU4h.o:dad.cpp:(.text+0xaf): undefined reference to `std::basic_ostream <char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_t raits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))'
/tmp/ccloHU4h.o:dad.cpp:(.text+0xba): undefined reference to `std::__cxx11::basi c_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()'
/tmp/ccloHU4h.o:dad.cpp:(.text+0xc8): undefined reference to `std::cin'
/tmp/ccloHU4h.o:dad.cpp:(.text+0xd4): undefined reference to `std::basic_istream <char, std::char_traits<char> >& std::operator>><char, std::char_traits<char>, s td::allocator<char> >(std::basic_istream<char, std::char_traits<char> >&, std::_ _cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
/tmp/ccloHU4h.o:dad.cpp:(.text+0xe2): undefined reference to `std::cout'
/tmp/ccloHU4h.o:dad.cpp:(.text+0xe7): undefined reference to `std::basic_ostream <char, std::char_traits<char> >& std::operator<< <char, std::char_traits<char>, std::allocator<char> >(std::basic_ostream<char, std::char_traits<char> >&, std:: __cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const &)'
/tmp/ccloHU4h.o:dad.cpp:(.text+0xf7): 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/ccloHU4h.o:dad.cpp:(.text+0x108): undefined reference to `std::basic_ostrea m<char, std::char_traits<char> >& std::operator<< <char, std::char_traits<char>, std::allocator<char> >(std::basic_ostream<char, std::char_traits<char> >&, std: :__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > cons t&)'
/tmp/ccloHU4h.o:dad.cpp:(.text+0x118): undefined reference to `std::basic_ostrea m<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std: :basic_ostream<char, std::char_traits<char> >&, char const*)'
/tmp/ccloHU4h.o:dad.cpp:(.text+0x120): undefined reference to `std::basic_ostrea m<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std:: basic_ostream<char, std::char_traits<char> >&)'
/tmp/ccloHU4h.o:dad.cpp:(.text+0x128): undefined reference to `std::basic_ostrea m<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_ traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))'
/tmp/ccloHU4h.o:dad.cpp:(.text+0x13a): undefined reference to `std::__cxx11::bas ic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
/tmp/ccloHU4h.o:dad.cpp:(.text+0x156): undefined reference to `std::__cxx11::bas ic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
/tmp/ccloHU4h.o:dad.cpp:(.text+0x19f): undefined reference to `std::ios_base::In it::Init()'
/tmp/ccloHU4h.o:dad.cpp:(.text+0x1b6): undefined reference to `std::ios_base::In it::~Init()'
collect2: error: ld returned 1 exit status
는 GCC를 사용 ".CPP없이 파일 이름"GCC "파일 이름"-o를 입력 할 때 발생합니다 나는
#include <iostream>
#include <string>
using namespace std;
코드에 포함했다.
나는 또한 코딩에 매우 익숙하다. 따라서 간단한 문제인 경우 농담이라고 생각하지 마십시오. 실제로 도움이 필요해.
gcc는 C 컴파일러이고, g ++는 C++ 컴파일러입니다. 당신은 잘못된 프로그램을 부르고 있습니다. –