Author Topic: cannot find origin of problem reported by TDM-minGW  (Read 4410 times)

Offline Ancient8724

  • Single posting newcomer
  • *
  • Posts: 5
cannot find origin of problem reported by TDM-minGW
« on: February 11, 2013, 04:11:58 pm »
I have tried to compile a program ("Conversion", from Ch 01 of C++ for Dummies) using the 12.11 download, as well as the version included in the book, now unistalled, all in Windows 7. I have done this on several downloads (those which actually installed;  the -user download wouldn't but the other did !), in the past month, and each time I get an error message like this:

mingw32-g++.exe -Weffc++ -pedantic -std=c++0x -Wextra -Wall -Wc++0c-compat    -c C:\CPP_Programs\Chap01\Conversion\convert.cpp -o C:\CPP_Programs\Chap01\Conversion\convert.o
mingw32-g++.exe: error: unrecognized command line option '-Wc++0c-compat'

Am I correct that it should be '-Wc++-compat' ?  if I am not correct, what should it be ?
Does it come from the Code::Blocks editor ? and how do I change it ?
If not, does it come from something included in the TDM-MinGW compiler, and if so, how do I change it ?

If this is in the wrong forum, I appologize.

Offline jarod42

  • Multiple posting newcomer
  • *
  • Posts: 82
Re: cannot find origin of problem reported by TDM-minGW
« Reply #1 on: February 11, 2013, 05:52:28 pm »
See Project -> Build options : Compiler settings
Compiler flags & other options
(And Settings... -> Compiler)

On recent gcc version, it is -Wc++11-compat (and it should be redundant as it is included with -Wall)
you may also use -std=c++11 instead of -std=c++0x

Offline Ancient8724

  • Single posting newcomer
  • *
  • Posts: 5
Re: cannot find origin of problem reported by TDM-minGW
« Reply #2 on: February 12, 2013, 04:09:25 am »
Thank you for the reply, Jarod42. It set me on an interesting route..

Instead of modifying Project/Build Options/Compiler Settings, which added the '-std=c++11' to the front of the options, but left the '-Wc++0c-compat' at the end of the previous list of commands, I went to the Settings tab, chose Compiler from the drop down, and on a similar list of command options, unticked '-std=Wc++0c' and ticked '-std=Wc==11'. On 'Build'ing the program, I got the following Build log message:

"
mingw32-g++.exe -Wall -fexceptions  -g  -Weffc++ -pedantic -std=c++11 -Wextra -Wall -Wc++0c-compat    -c C:\CPP_Programs\Chap01\Conversion\convert.cpp -o obj\Debug\convert.o
mingw32-g++.exe: error: unrecognized command line option '-Wc++0c-compat'
"
Where is the '-compat' command being generated, now that the c++11 problem is solved ?

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: cannot find origin of problem reported by TDM-minGW
« Reply #3 on: February 12, 2013, 06:19:36 am »
Did you look at all possible places which options you have set ?
"Build options -> [your project] -> Compiler settings -> {Compiler flags,Otheroptions}",
"Build options -> [your project] -> [actual target] -> Compiler settings -> {Compiler flags,Otheroptions}",
"Settings -> Compiler... -> Global compiler settings -> {your compiler] -> Compiler settings -> {Compiler flags,Otheroptions}"

Using the global compiler settings is only recommended if you want to add the settings for each and any project you want to compile with this compiler (n most cases not a good idea, unless you know exactly what you do).

And for all settings: you should read the compilers docs what they do and you should consider whether you rally need them or not, or whether you really need to experiment with them at this stage of programming knowledge.


Offline Ancient8724

  • Single posting newcomer
  • *
  • Posts: 5
Re: cannot find origin of problem reported by TDM-minGW
« Reply #4 on: February 14, 2013, 12:36:12 pm »
FOUND !!!

Thanks for suggeting I read the documentation - as you will find in your site list of all the commands for the MinGW compiler, there is no documentation on the offending particle precisely because the compiler does not recognise it - like looking in the Oxford English Dictionary for the meaning of 'supercallifragilisticexpialidocious' which, not being a word, is not defined in the OED ::).

The fault lies in the distribution of the C::B 12.11 for Windows .. 7, with which there are at least two MAJOR problems to fix, IMHO :
  1) in the global 'Settings/Compiler Settings/other options' the distiruted program for the 'codeblocks-12.11mingw-setup.exe', some one has left in '-Wc++0c=compat', which caused my problem.
  2) When you claimed that codeblocks-12.11mingw-setup_user.exe would install without Administrator permission. It did not, but codeblocks-12.11mingw-setup.exe did.