I know it might be awkward to ask this type of question but really this bug is causing a lot of problem for me. I used the cpp mathematical parsing code from this link.
C++ Implementation of Basic Expression Parser
http://www.technical-recipes.com/2011/a-mathematical-expression-parser-in-java-and-cpp/[
^]
Now I first compiled the code in Dev c++ . It compiled perfectly and I got the desired output
But when I created a visual c++ win32 console application and used the above code and I got the following errors
[02/09/14 6:07:39 pm] GAURAV LUTHRA: Error 1 error C2664: 'std::pair<int,int> std::make_pair<int,int>(_Ty1 &&,_Ty2 &&)' : cannot convert argument 2 from 'const int' to 'int &&' c:\users\linchpin66\documents\visual studio 2013\projects\consoleapplication4\consoleapplication4\consoleapplication4.cpp 25 1 ConsoleApplication4
[02/09/14 6:09:21 pm] GAURAV LUTHRA: Error 2 error C2440: '<function-style-cast>' : cannot convert from 'const char [2]' to 'std::pair<const _Kty,_Ty>' c:\users\linchpin66\documents\visual studio 2013\projects\consoleapplication4\consoleapplication4\consoleapplication4.cpp 25 1 ConsoleApplication4
[02/09/14 6:09:31 pm] GAURAV LUTHRA: Error 3 error C2664: 'std::pair<int,int> std::make_pair<int,int>(_Ty1 &&,_Ty2 &&)' : cannot convert argument 2 from 'const int' to 'int &&' c:\users\linchpin66\documents\visual studio 2013\projects\consoleapplication4\consoleapplication4\consoleapplication4.cpp 26 1 ConsoleApplication4
[02/09/14 6:09:45 pm] GAURAV LUTHRA: Error 4 error C2440: '<function-style-cast>' : cannot convert from 'const char [2]' to 'std::pair<const _Kty,_Ty>' c:\users\linchpin66\documents\visual studio 2013\projects\consoleapplication4\consoleapplication4\consoleapplication4.cpp 26 1 ConsoleApplication4
[02/09/14 6:09:52 pm] GAURAV LUTHRA: Error 5 error C1903: unable to recover from previous error(s); stopping compilation c:\users\linchpin66\documents\visual studio 2013\projects\consoleapplication4\consoleapplication4\consoleapplication4.cpp 26 1 ConsoleApplication4
[02/09/14 6:10:01 pm] GAURAV LUTHRA: 6 IntelliSense: no instance of function template "std::make_pair" matches the argument list
argument types are: (int, const int) c:\Users\Linchpin66\Documents\Visual Studio 2013\Projects\ConsoleApplication4\ConsoleApplication4\ConsoleApplication4.cpp 25 26 ConsoleApplication4
[02/09/14 6:10:11 pm] GAURAV LUTHRA: 7 IntelliSense: no instance of function template "std::make_pair" matches the argument list
argument types are: (int, const int) c:\Users\Linchpin66\Documents\Visual Studio 2013\Projects\ConsoleApplication4\ConsoleApplication4\ConsoleApplication4.cpp 26 24 ConsoleApplication4
[02/09/14 6:10:22 pm] GAURAV LUTHRA: 8 IntelliSense: no instance of function template "std::make_pair" matches the argument list
argument types are: (int, const int) c:\Users\Linchpin66\Documents\Visual Studio 2013\Projects\ConsoleApplication4\ConsoleApplication4\ConsoleApplication4.cpp 27 24 ConsoleApplication4
[02/09/14 6:10:31 pm] GAURAV LUTHRA: 9 IntelliSense: no instance of function template "std::make_pair" matches the argument list
argument types are: (int, const int) c:\Users\Linchpin66\Documents\Visual Studio 2013\Projects\ConsoleApplication4\ConsoleApplication4\ConsoleApplication4.cpp 28 24 ConsoleApplication4
I got around 9 errors. I know that there might be some library issues that visual studio uses. I am making a mathematical expression parsing app in windows. There somewhere it uses the
snprintf() function which no longer exists in visual studio c library. Infact we have a
_snprintf() function which doesn't provide the required functionality that I need and the app crashes in output.c file.
So how can we resolve this issue such that I can use the the
snprintf() function in visual studio and how can we run the above code present in the link in win32 console app in Visual studio. I used visual studio 2012 and 2013. There are some more issues like arc4random doesn't work and we have to use
rand and
srand functions.
Searched a lot but unable to find the solution. Is it possible to change the compiler of my visual studio to C99 library where all these functions exist? Any help will be highly appreciated. Thanks