OneLoneCoder / CommandLineFPS

A First Person Shooter at the command line? Yup...
599 stars 173 forks source link

swprint_s was not declared in this scope / C++ #8

Closed mrdcvlsc closed 1 year ago

mrdcvlsc commented 4 years ago

the function "swprintf_s" was not declared says the compiler :(

i already included the "cstdio" "wchar.h", and the "stdio" but it is not working please help...

ailijic commented 4 years ago

You can comment it out; it is only printing out the player position and frame rate. I was able to get it to compile by changing it to "swprintf".

emredav commented 4 years ago

You can use " _snwprintf " or "snwprintf" if you use "swprintf" you will get error(invalid conversion from 'int' to 'const wchar_t*') .

snwprintf(screen, 40, L"X=%3.2f, Y=%3.2f, A=%3.2f FPS=%3.2f ", fPlayerX, fPlayerY, fPlayerA, 1.0f/fElapsedTime);

chiboubys commented 3 years ago

you can use: swprintf it will work for you

mrdcvlsc commented 1 year ago

wow I forgot to close this almost 3 years ago, late thanks everything is working! :)