I tried to compile yo.cpp file from terminal but it is giving this error on my macbook monterey air intel. I have already installed gcc-11. The file is compiling when Iuse clang compiler.
Undefined symbols for architecture x86_64:"__ZNSt8ios_base15sync_with_stdioEb", referenced from: __Z11NeverGiveUpv in cca7hviB.o"__ZNSt8ios_base4InitC1Ev", referenced from: __Z41__static_initialization_and_destruction_0ii in cca7hviB.o"__ZNSt8ios_base4InitD1Ev", referenced from: __Z41__static_initialization_and_destruction_0ii in cca7hviB.o"__ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo", referenced from: __Z11NeverGiveUpv in cca7hviB.o"__ZSt17__throw_bad_allocv", referenced from: __ZN9__gnu_cxx13new_allocatorISt4pairIiiEE8allocateEmPKv in cca7hviB.o"__ZSt20__throw_length_errorPKc", referenced from: __ZNKSt6vectorISt4pairIiiESaIS1_EE12_M_check_lenEmPKc in cca7hviB.o"__ZSt28__throw_bad_array_new_lengthv", referenced from: __ZN9__gnu_cxx13new_allocatorISt4pairIiiEE8allocateEmPKv in cca7hviB.o"__ZSt3cin", referenced from: __Z11NeverGiveUpv in cca7hviB.o"__ZSt4cout", referenced from: __Z11NeverGiveUpv in cca7hviB.o"__ZdlPvm", referenced from: __ZN9__gnu_cxx13new_allocatorISt4pairIiiEE10deallocateEPS2_m in cca7hviB.o"__Znwm", referenced from: __ZN9__gnu_cxx13new_allocatorISt4pairIiiEE8allocateEmPKv in cca7hviB.o (maybe you meant: __ZnwmPv)"___gxx_personality_v0", referenced from: Dwarf Exception Unwind Info (__eh_frame) in cca7hviB.old: symbol(s) not found for architecture x86_64collect2: error: ld returned 1 exit status```