undefined reference to `__chkstk_ms'
I'm having this problem in both CLion and Eclipse. I have both 32b and 64b MinGW installed, I installed every item from the Compiler Suite, everything C-related. I installed the most recent version of CMake. When installing CLion, there were no error messages, nothing was missing. Now, after creating a simple "hello world" project, I get this:
EDIT: I run it on a Windows 7 PC
Error:Configuration MinSizeRel
The C compiler "C:/MinGW/bin/gcc.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/martmaco/.CLion2016.2/system/cmake/generated/00_04-c8f1aa93/c8f1aa93/MinSizeRel/CMakeFiles/CMakeTmp
Run Build Command:"C:/MinGW/bin/mingw32-make.exe" "cmTC_f3ab1/fast"
C:/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTC_f3ab1.dir\build.make CMakeFiles/cmTC_f3ab1.dir/build
mingw32-make.exe[1]: Entering directory 'C:/Users/martmaco/.CLion2016.2/system/cmake/generated/00_04-c8f1aa93/c8f1aa93/MinSizeRel/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_f3ab1.dir/testCCompiler.c.obj
C:\MinGW\bin\gcc.exe -o CMakeFiles\cmTC_f3ab1.dir\testCCompiler.c.obj -c C:\Users\martmaco\.CLion2016.2\system\cmake\generated\00_04-c8f1aa93\c8f1aa93\MinSizeRel\CMakeFiles\CMakeTmp\testCCompiler.c
Linking C executable cmTC_f3ab1.exe
"C:\Users\martmaco\AppData\Roaming\JetBrains\CLion 2016.2.3\bin\cmake\bin\cmake.exe" -E cmake_link_script CMakeFiles\cmTC_f3ab1.dir\link.txt --verbose=1
C:\MinGW\bin\gcc.exe -Wl,@CMakeFiles\cmTC_f3ab1.dir\objects1.rsp -o cmTC_f3ab1.exe -Wl,--out-implib,libcmTC_f3ab1.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
/mingw/lib/libmingw32.a(setargv.o):(.text+0x33): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0x5d6): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0x6a9): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0x86b): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0x8b4): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0xb2e): more undefined references to `__chkstk_ms' follow
collect2: ld returned 1 exit status
CMakeFiles\cmTC_f3ab1.dir\build.make:97: recipe for target 'cmTC_f3ab1.exe' failed
mingw32-make.exe[1]: *** [cmTC_f3ab1.exe] Error 1
mingw32-make.exe[1]: Leaving directory 'C:/Users/martmaco/.CLion2016.2/system/cmake/generated/00_04-c8f1aa93/c8f1aa93/MinSizeRel/CMakeFiles/CMakeTmp'
Makefile:125: recipe for target 'cmTC_f3ab1/fast' failed
mingw32-make.exe: *** [cmTC_f3ab1/fast] Error 2
CMake will not be able to correctly generate this project.
Any ideas what's missing or wrong with my system? I installed everything yesterday so everything should be up to date.
Please sign in to leave a comment.
Please take a look at http://stackoverflow.com/questions/18649173/how-to-solve-undefined-reference-to-chkstk-ms-on-mingw. Does that help?
I saw that, but the problem discussed on stackoverflow seems to be caused by a MinGW version conflict, while my output does not mention the version at all (and I only installed it recently so I shouldn't have any older version on my computer).
Also, the solution is showing Linux commands which won't run on my Windows.