Author Topic: Need help updating MinGW  (Read 5840 times)

Offline Geowil

  • Multiple posting newcomer
  • *
  • Posts: 10
Need help updating MinGW
« on: March 17, 2014, 04:04:08 am »
After installing Code::Blocks I ported my code over to a new CB project and tried to build it.  It got about 300 errors stating that to_string was not declared within the scope of the code.  I also got this error for atoi and floor.  I did some intense Googling and found that this is caused by a bug in MinGW 4.7.  So I downloaded TDM 4.8.1 and installed it over the Mingw folder in the codeblocks directory but the problems still persist.

I have checked the c++11 flag in build options and I have repointed my toolchain exes but the errors are still showing up; they don't in MSVS 2012.  Am I missing something or is Mingw just not ready for c++11 code yet?

Edit:

A bit more info:
Windows 7 64-bit
CB 13.12
Mingw 4.8.1 (tried 32 & 64 bit)
« Last Edit: March 17, 2014, 05:34:55 am by Geowil »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: Need help updating MinGW
« Reply #1 on: March 17, 2014, 10:13:37 am »
installing something over a other thing is always a bad idea. It is better to uninstall/delete the old version, and install then the new.
Have you checked that you are using the right compiler path? Have you also a c:\mingw folder? Delete it, or use only this one (what i would prefere)

greetings

Offline Geowil

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Need help updating MinGW
« Reply #2 on: March 22, 2014, 01:38:43 am »
installing something over a other thing is always a bad idea. It is better to uninstall/delete the old version, and install then the new.
Have you checked that you are using the right compiler path? Have you also a c:\mingw folder? Delete it, or use only this one (what i would prefere)

greetings

Under your advice I uninstalled Code::Blocks and then reinstalled it.  I also deleted my Mingw folder and redownloaded both the 32-bit and 64-bit versions from TDM.  I attempted to use the 32-bit version of Mingw again, this time I unchecked the "create PATH entry" line during install and deleted the Mingw folder contents in the Codeblocks folder.  After reapplying the correct flags I attempted to compile the default hello world program with a to_string call added but it would still not compile.

After some more searching I read that the only version of Mingw that has been found to work with c++11 is the 64-bit version.  So I deleted out the Mingw folder again and installed the 64-bit version then moved the files over and retargeted the toolchain links.  This time it was able to compile the program with the to_string line in it.  Not sure why the 32-bit version of 4.8.1 doesn't work.

Offline gd_on

  • Lives here!
  • ****
  • Posts: 824
Re: Need help updating MinGW
« Reply #3 on: March 22, 2014, 08:13:09 am »
Personaly, I have TDM 32 and 64 bits version installed and working. They are respectively installed in C:MinGW32 and C:\MinGW64 and configured like that in compilers CB base paths.
As told on TDM site, it's better to avoid C:\MinGW.
In my path they are declared as follow : C:\MinGW32\bin;C:\MinGW64\bin;... in this order.
In C::B, the 64 bits compiler versions are configured with their specific name x86_64_...
Like that it works perfectly.

gd_on
« Last Edit: March 22, 2014, 08:32:26 am by gd_on »
Windows 11 64 bits (24H2), svn C::B (last version or almost!), wxWidgets 3.2.8 (tests with 3.3), Msys2 Compilers 15.1.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline Geowil

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Need help updating MinGW
« Reply #4 on: March 22, 2014, 10:01:02 am »
Personaly, I have TDM 32 and 64 bits version installed and working. They are respectively installed in C:MinGW32 and C:\MinGW64 and configured like that in compilers CB base paths.
As told on TDM site, it's better to avoid C:\MinGW.
In my path they are declared as follow : C:\MinGW32\bin;C:\MinGW64\bin;... in this order.
In C::B, the 64 bits compiler versions are configured with their specific name x86_64_...
Like that it works perfectly.

gd_on


Just tried your setup (using D:\TDM-GCC-32\bin and -64\bin) and it does not work for me (32-bit errors out on to_string while 64-bit does not).  Wondering if something else on my system is interfering with Code::Blocks.