Linking with -static-libstdc++ flag on MinGW 4.7.1 [closed]

一曲冷凌霜 提交于 2019-11-29 18:22:57

问题


I try to compile (Allegro 5) on MinGW 4.7.1
(using Code::Blocks 12.11 on Win 7)
with compiler flags
(write them in Project :: Linker settings :: Other linker settings):

-static-libgcc
-static-libstdc++

Result:

unrecognized command line option '-static-libstdc++'

How to solve it?


回答1:


What does g++ --version say? I don't know the exact version when it was introduced, but -static-libstdc++ is a fairly recent addition. Before, you had to do something like -static -lstdc++ -dynamic. (If the compiler version is 4.7.1, this should not be a problem, but I don't know how MinGW versions map to the actual compiler version.)




回答2:


I have not tested but try to separate as -static -libstdc++




回答3:


The following link can help you. It explains how to link static library in c++ http://www.trilithium.com/johan/2005/06/static-libstdc/



来源:https://stackoverflow.com/questions/14225083/linking-with-static-libstdc-flag-on-mingw-4-7-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!