PhillipKP / congenial-spoon

A guess the number game written in C++17, with Xcode 12 for Mac OS Catalina and MS Visual Studio 2019 for Windows 10.
0 stars 0 forks source link

Random number generator code doesn't work on MSVC #5

Closed PhillipKP closed 4 years ago

PhillipKP commented 4 years ago

This is the list of errors I get when trying to build in visual studio for Windows 10. The code for generating the random number works with XCode but it does not work in MS Visual Studio. Please figure out why and fix.

Severity Code Description Project File Line Suppression State
Warning C4244 '=': conversion from 'int' to 'float', possible loss of data ConsoleApplication6 C:\Users\poon\source\repos\ConsoleApplication6\main.cpp 56  
Error C2514 'std::uniform_int_distribution': class template cannot be constructed ConsoleApplication6 C:\Users\poon\source\repos\ConsoleApplication6\main.cpp 27  
Error C2955 'std::uniform_int_distribution': use of class template requires template argument list ConsoleApplication6 C:\Users\poon\source\repos\ConsoleApplication6\main.cpp 27  
Error (active) E0441 argument list for class template "std::uniform_int_distribution" is missing ConsoleApplication6 C:\Users\poon\source\repos\ConsoleApplication6\main.cpp 27  
Error (active) E0065 expected a ';' ConsoleApplication6 C:\Users\poon\source\repos\ConsoleApplication6\main.cpp 27  
Error (active) E0020 identifier "die" is undefined ConsoleApplication6 C:\Users\poon\source\repos\ConsoleApplication6\main.cpp 30  
PhillipKP commented 4 years ago

Works now. See commit 9dbe95d4a7ad8897b44abb768370da8bf178891c.