自从不小心把gcc删掉后,重新安装在clion下编译就出现了这个问题。
Undefined symbols for architecture x86_64:\
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(char const*, unsigned long)", referenced from:\
_main in main.o\
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()", referenced from:\
_main in main.o\
"std::terminate()", referenced from:\
___clang_call_terminate in main.o\
"___cxa_begin_catch", referenced from:\
___clang_call_terminate in main.o\
"___gxx_personality_v0", referenced from:\
_main in main.o\
Dwarf Exception Unwind Info (__eh_frame) in main.o\
ld: symbol(s) not found for architecture x86_64\
clang: error: linker command failed with exit code 1 (use -v to see invocation)\
make: *** [main] Error 1\
在编译选项的时候,将重新安装的gcc和g++目录重新填入
还不行的话,在终端下编译选项添加-lstdc++