11

I know this seems like a duplicate of this question and many more, but hear me out. That question points to MingGW, which, as far as I can tell, only has version 4.8.whatever of gcc with it. I tried Cygwin, but Cygwin never really worked with my IDE.

I'm trying to add the exe for G++ 4.9 to the GNU GCC Compiler that comes with CodeBlocks. I just need the g++.exe for the #include <regex>.

Community
  • 1
  • 1
rootmeanclaire
  • 808
  • 3
  • 13
  • 37
  • 1
    I think that cigwin is the best way for gcc on Windows. What's your OS ? – Damiii Jun 07 '14 at 01:02
  • 1
    Even with 4.8, invoking g++ with the `-std=c++11` switch should work... Not sure about MinGW... – selbie Jun 07 '14 at 07:36
  • @selbie I'm a noob, how would I do that? _(Post as answer please.)_ – rootmeanclaire Jun 08 '14 at 22:37
  • Type `g++ -std=c++11 mycode.cpp` at the command line. – selbie Jun 09 '14 at 03:00
  • @selbie `cc1plus.exe: error: unrecognized command line option "-std=c++11"` – rootmeanclaire Jun 09 '14 at 18:44
  • 2
    Have you considered just using Visual Studio Express? VS is a free download these days and is largely C++11 compliant. – selbie Jun 09 '14 at 19:28
  • @selbie `error C2784: 'bool std::tr1::regex_match(const std::basic_string<_Elem,_StTraits,_StAlloc> &,const std::tr1::basic_regex<_Elem,_RxTraits> &,std::tr1::regex_constants::match_flag_type)' : could not deduce template argument for 'const std::tr1::basic_regex<_Elem,_RxTraits> &' from 'const std::string'` – rootmeanclaire Jun 09 '14 at 20:33

2 Answers2

6

Use the distro from this site, they have g++ 4.9.2 which supports

gath
  • 24,504
  • 36
  • 94
  • 124
0

You can install MinGW. It contains GCC and G++

Peter Csala
  • 17,736
  • 16
  • 35
  • 75
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 01 '22 at 07:36