"instantiation of" errors when trying to use ttmath

26 Mar 2011

http://frank.circleofcurrent.com/junk/mbed_ttmath_errs.png

it's bad enough that I can't really use ttmath because exceptions are disabled (please enable it and let the users choose whether or not to actually use it)... but I don't even know what's wrong with the instantiations

if I tried to compile the code like

#include "mbed.h"

typedef ttmath::Big<1,1> MyBig; // put this on top

#include <ttmath/ttmath.h>
#include <iostream>

int main()
{
    ttmath::Parser<MyBig> parser;

    const char equation[] = "(34 + 24) * 123 - 34.32 ^ 6 * sin(2.56) - atan(10)";

    ttmath::ErrorCode err = parser.Parse(equation);

    /*
    if (err == ttmath::err_ok) {
        std::cout << parser.stack[0].value << std::endl;
    }
    else {
        std::cout << "Error: "
                  << static_cast<int>(err)
                  << std::endl;
    }
    // */
    
    while (1);
}

then the compiler will not respond until I receive a 504 error (gateway timed out)

if I try

#include <ttmath/ttmathbig.h>

typedef ttmath::Big<1,1> MyBig;

#include <ttmath/ttmath.h>

then I get the same errors as the first screenshot

then I added

#define TTMATH_DONT_USE_WCHAR
#define TTMATH_NOASM
#define TTMATH_PLATFORM32

to the top of the file, still doesn't help

how do I solve these errors? if you want to see ttmath, go http://www.ttmath.org/ or http://publicrep.ttmath.org/viewvc.py/ttmath/trunk/ttmath/ for the files

oh and i forgot to mention that the code is from the parser sample code