Author Topic: Build failed, " unrecognized command line option "-std=c++11" "  (Read 7538 times)

Offline bjor

  • Single posting newcomer
  • *
  • Posts: 5
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Build failed, " unrecognized command line option "-std=c++11" "
« Reply #1 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.
« Last Edit: May 14, 2021, 04:45:45 pm by oBFusCATed »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline bjor

  • Single posting newcomer
  • *
  • Posts: 5
Re: Build failed, " unrecognized command line option "-std=c++11" "
« Reply #2 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..

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Build failed, " unrecognized command line option "-std=c++11" "
« Reply #3 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Build failed, " unrecognized command line option "-std=c++11" "
« Reply #4 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

Offline bjor

  • Single posting newcomer
  • *
  • Posts: 5
Re: Build failed, " unrecognized command line option "-std=c++11" "
« Reply #5 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?

Offline bjor

  • Single posting newcomer
  • *
  • Posts: 5
Re: Build failed, " unrecognized command line option "-std=c++11" "
« Reply #6 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)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Build failed, " unrecognized command line option "-std=c++11" "
« Reply #7 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Build failed, " unrecognized command line option "-std=c++11" "
« Reply #8 on: May 14, 2021, 06:54:21 pm »
What else can I do?
Post the full build log using code tags (the # button).
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline bjor

  • Single posting newcomer
  • *
  • Posts: 5
Re: Build failed, " unrecognized command line option "-std=c++11" "
« Reply #9 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.
 

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Build failed, " unrecognized command line option "-std=c++11" "
« Reply #10 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?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]