-static-libstdc++ works on g++ but not on pure gcc?
问题 For the reference I'm using MinGW (GCC 5.3). When compiling a file with g++ file.cc -static-libstdc++ it statically links the C++ standard lib ( libstdc++ ) and produces a 1.9MB executable. However running gcc -lstdc++ -static-libstdc++ file.cc it still dynamically links to libstdc++-6.dll and produces a 34KB executable. Why does -static-libstdc++ only work with g++ but not with pure gcc ? 回答1: The GCC manual, Link Options says: -static-libstdc++ When the g++ program is used to link a C++