How to solve -------undefined reference to `__chkstk_ms'-------on mingw

前端 未结 6 857
终归单人心
终归单人心 2020-12-04 00:23

I have just install gcc and g++ on mingw. I wrote a very simple \"hello world\" program to test if the g++ compiler worked. Code:

#include 
u         


        
6条回答
  •  我在风中等你
    2020-12-04 00:50

    The orig problem seems solved regarding linking against old libs, but I have opposite case. I need to work with older GCC 3.4 version, so I installed gcc-v3-core package. Then orig errors immediately appear when linking a trivial source. I found out that MinGW GCC 3.4 cannot work with mingwrt > 3.20 and the problem is that gcc-v3-core contains incorrect mingwrt spec, allowing newest vesions.

    The solution is simple:

    mingw-get upgrade "mingwrt=3.20.*"
    

    !Update! Actually with mingwrt-3.20 linker reports same errors for C++ code:

    g++ hello.cpp
    

    BAM!

    Solution 2:

    mingw-get upgrade "mingwrt=3.18.*"
    

    the last one that seems to work with gcc-v3-g++.

提交回复
热议问题