mdbtxt1
mdbtxt2
Proceed to Safety

C++ Linker Errors from GCC Compiler    

The following errors come from compiling a simple C++ program using the command:

gcc simple-cpp-program.cpp -o scppp

The error typically looks like:

Undefined symbols for architecture x86_64: "__ZNKSt7__cxx1112basic_stringIcSt11char", referenced from: __ZStplIcSt11char_S9_ in ccBDqkud.o . . . [a lot more here] . . . "___gxx_personality_v0", referenced from: Dwarf Exception Unwind Info (__eh_frame) in ccBDqkud.o ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status

If you really used the "gcc" command as shown above, then the first thing to try is to use g++ instead of "gcc":

g++ simple-cpp-program.cpp -o scppp

Following is a non-exhaustive list of the nonsense labels (they are appropriately called C++ mangled names) that I get just by using stdio to files and the screen.

__Z41__static_initialization_and_destruction_0ii __ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13get_allocatorEv __ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv __ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE8capacityEv __ZNKSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEE3strEv __ZNSaIcEC1ERKS_ __ZNSaIcEC1Ev __ZNSaIcED1Ev __ZNSolsEPFRSoS_E __ZNSolsEi __ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode __ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev __ZNSt16allocator_traitsISaIcEE37select_on_container_copy_constructionERKS0_ __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendERKS4_ __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6insertEmRKS4_ __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7reserveEm __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1EOS4_ __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1EPKcRKS3_ __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1ERKS3_ __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1ERKS4_ __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1Ev __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev __ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_ __ZNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEEC1Ev __ZNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEED1Ev __ZNSt8ios_base4InitC1Ev __ZNSt8ios_base4InitD1Ev __ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_ __ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc __ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE __ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEOS8_PKS5_ __ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEOS8_RKS8_ __ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEOS8_S9_ __ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_ __ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_ ___gxx_personality_v0


Robert Munafo's home pages on AWS    © 1996-2024 Robert P. Munafo.    about    contact
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License. Details here.

This page was written in the "embarrassingly readable" markup language RHTF, and was last updated on 2024 Jan 13. s.27