dimanche 29 octobre 2017

Unable to run workable VS2015 C++ program in ubuntu

I've been able to run C++ program that is developed in Visual Studio 2015 in Ubuntu for a longest time using this command

g++ -c -std=c++11 Example1.cpp Example2.cpp

g++ Example1.o Example2.o -o Execute.exe

./Execute.exe

However now i'm having errors such as this despite using the same way of running the program.

‘numeric_limits’ was not declared in this scope
cin.ignore(numeric_limits<streamsize>::max(), '\n');

I've ensured that i've added all the necessary header as well. Even my virtual function is returning an error stating that

call of overloaded ‘abs(double)’ is ambiguous

This is how i declare my virtual function in my .h file

virtual bool correctMath(int x, int y);

and this is how i utilize the virtual function

bool Square::isPointOnShape(int x, int y)
{     
    double x = x*2;
    double y = y*3;
    if (abs(x/y) < 0.00001) return true;
}

It's running perfectly on my VS2015 but not on my Ubuntu.

My visual studio target platform : 8.1, platform toolkit : v140 where as my ubuntu's version is 14.04.

Aucun commentaire:

Enregistrer un commentaire