Code::Blocks Forums

User forums => Help => Topic started by: bjor on May 14, 2021, 02:42:02 pm

Title: Build failed, " unrecognized command line option "-std=c++11" "
Post by: bjor on May 14, 2021, 02:42:02 pm
I'm going to lose my mind with Code::Blocks. I've installed and uninstalled it a 100 times by now, and every time I try something a little bit different than the last. Every time I try to build and run a program it outputs this into the "Build messages". I know it's a compiler problem but I still don't know how to solve it. This isn't the forum for it probably, but I don't know where else to turn to. If anyone could just nudge me into the direction why this is happening, I would be over the moon.
Title: Re: Build failed, " unrecognized command line option "-std=c++11" "
Post by: oBFusCATed on May 14, 2021, 03:25:44 pm
https://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_How_do_I_troubleshoot_a_compiler_problem.3F
Inspect the build log. If nothing clicks you can post it and someone would be able to help you most probably.
Title: Re: Build failed, " unrecognized command line option "-std=c++11" "
Post by: bjor on May 14, 2021, 04:27:24 pm
I've restored in settings -> Compiler to default. Now this message appears in Build Log:
/mingw/lib/libmingw32.a(setargv.o):(.text+0x33): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0x6d2): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0x8b8): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0x900): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0xa25): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0xc15): more undefined references to `__chkstk_ms' follow
I've seen this after a quick google: https://stackoverflow.com/questions/18649173/how-to-solve-undefined-reference-to-chkstk-ms-on-mingw
Still have no clue how to fix this since I don't understand the solution here..
Title: Re: Build failed, " unrecognized command line option "-std=c++11" "
Post by: oBFusCATed on May 14, 2021, 04:45:57 pm
Inspect the build log. If nothing clicks you can post it and someone would be able to help you most probably.
Title: Re: Build failed, " unrecognized command line option "-std=c++11" "
Post by: BlueHazzard on May 14, 2021, 04:56:22 pm
Follow exactly the instructions given by obfuscated:
https://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

so we can try to help you
Title: Re: Build failed, " unrecognized command line option "-std=c++11" "
Post by: bjor on May 14, 2021, 05:16:13 pm
Ok, I'm trying my best. I've read through the "Q: How do I troubleshoot a compiler problem?" part, and done the "Full command line" (this was already checked), and the same thing appears in build log. Ive re-built the project (it's just hello world) and nothing new to note. What else can I do?
Title: Re: Build failed, " unrecognized command line option "-std=c++11" "
Post by: bjor on May 14, 2021, 05:18:03 pm
Sorry for double bumping, but wanted to add pictures: (this is just the compiler settings, I've messed around in here and I think here is where I will hopefully fix the problem)
Title: Re: Build failed, " unrecognized command line option "-std=c++11" "
Post by: stahta01 on May 14, 2021, 06:28:14 pm
I've restored in settings -> Compiler to default. Now this message appears in Build Log:
/mingw/lib/libmingw32.a(setargv.o):(.text+0x33): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0x6d2): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0x8b8): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0x900): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0xa25): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0xc15): more undefined references to `__chkstk_ms' follow
I've seen this after a quick google: https://stackoverflow.com/questions/18649173/how-to-solve-undefined-reference-to-chkstk-ms-on-mingw
Still have no clue how to fix this since I don't understand the solution here..

No idea if this is related; but, I had an error like above that appeared to be an GCC build issue related to GCC version and MinGW C runtime library version mis match. So, I would check your MinGW GCC installation version and mingw CRT version.

Tim S.
Title: Re: Build failed, " unrecognized command line option "-std=c++11" "
Post by: oBFusCATed on May 14, 2021, 06:54:21 pm
What else can I do?
Post the full build log using code tags (the # button).
Title: Re: Build failed, " unrecognized command line option "-std=c++11" "
Post by: bjor on May 14, 2021, 07:13:46 pm
@Above:
#-------------- Build: Debug in etasda (compiler: GNU GCC Compiler)---------------

g++.exe -Wall -fexceptions -g  -c C:\Users\user\Desktop\codeblox\etasda\main.cpp -o obj\Debug\main.o
g++.exe  -o bin\Debug\etasda.exe obj\Debug\main.o   
/mingw/lib/libmingw32.a(setargv.o):(.text+0x33): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0x6d2): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0x8b8): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0x900): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0xa25): undefined reference to `__chkstk_ms'
/mingw/lib/libmingwex.a(glob.o):(.text+0xc15): more undefined references to `__chkstk_ms' follow
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
6 error(s), 0 warning(s) (0 minute(s), 0 second(s))#
I hope this is what you meant?
@2above, I think so too. But how do I check that?
In CMD:
gcc (tdm-1) 5.1.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
How do I check the CRT thing? And also do I have to set something up in Code::Blocks? I've heard about linking stuff but I don't know how to do that.
 
Title: Re: Build failed, " unrecognized command line option "-std=c++11" "
Post by: oBFusCATed on May 14, 2021, 08:44:25 pm
Your compiler is just broken.
You have to find another release of MinGW which works. :(
What is broken I don't know.
Is this the only MinGW on your system?