3

i compile the project with the mingw and the project is cool compiler . this is a part of my code

#include "astnodecodegenerator.hpp"
#include "utility.hpp"
#include "constants.hpp"
#include <string>
#include <cmath>
#include <sstream>
#include <stack>

. . . .

void AstNodeCodeGenerator::visit(StringConst& str) 
{ 
    emit_la("a0", (std::string("str_const") + std::to_string(stringtable().get_idx(str.token.get_val()))).c_str());
}

void AstNodeCodeGenerator::visit(IntConst& int_const) 
{
    emit_la("a0", (std::string("int_const") + std::to_string(inttable().get_idx(int_const.token.get_val()))).c_str());
}

the error is:

error :'to_string' is not a member of 'std' emit_la<"a0",<std::string(("str_const") + std::to_string(stringtable().get_idx(str.token.get_val()))).c_str());
manlio
  • 18,345
  • 14
  • 76
  • 126
user3341263
  • 29
  • 1
  • 3

1 Answers1

1

It's not supported on MinGW because of limitations in the MinGW runtime that need changes from MinGW developers.

Take a look at these:

If you can use Boost, a good alternative is boost::lexical_cast (been there, done that).

manlio
  • 18,345
  • 14
  • 76
  • 126
  • have the mingw devs made any progress... there last bugpost about this 1571 was "closed" due to "out of date" but this is december 2014 and I STILL GET THIS PROBLEM!@!!! ARGH pulling hair here!!!! – Brian Jack Dec 01 '14 at 15:37
  • @BrianJack Its 2017, still gettin :D – Emin Mastizada Dec 10 '17 at 04:54