Quantcast
Viewing all articles
Browse latest Browse all 22077

-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?


Viewing all articles
Browse latest Browse all 22077

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>