Linking C++ code with ‘gcc’ (without g++)

You can link the standard c++ library with the -l flag to gcc:

gcc cplusplus.o -lstdc++ -o myexe

Leave a Comment