How is the C++ standard library linked to my application?

后端 未结 5 1777
情歌与酒
情歌与酒 2020-12-29 15:13

When I usually use code (include headers) from 3rd party (non-standard) C++ libraries, a pre-built binary file is linked to (or included in) the target executable that repre

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-29 15:38

    In recent MinGW gcc/g++ versions (4.40) you can link against a shared dll rather than the default static library by using the flag -shared-libstdc++.

    The static versions of the library are located in /mingw/lib/gcc/mingw32/[gcc version]. The file name is libstdc++.a. This will be linked in by default when compiling a c++ app with MinGW.

提交回复
热议问题