+ 2

Is there a way to make this C++ snake game demo functional on Windows 10?

For a homework, I have done a little Snake Game in C++, using SDL 2, and tested on ubuntu. https://code.sololearn.com/cZZBd29RwQlm The code works fine (it seems pretty basic, yes, I'm still learning how to use SDL 2 and C++) on Ubuntu, but when I tried to used it on Windows 10, it doesn't work, it doesn't start the game in the first place, Windows 10 tells me this: 16 bit application non compatible. I know that Ubuntu and Windows are different, but I thought that using SDL, I could use this game for Windows, (SDL says that is multiplatform), also I tried to program the most neutral way, to make functional code for both operating systems. I compiled everything from the terminal using g++ and the following commands: g++ main.cpp Game.hpp Game.cpp SnakeGame.hpp SnakeGame.cpp Snake.hpp Snake.cpp -Wall -Wextra -std=c++11 -lSDL2 -lSDL2_mixer -lSDL2_image -o main On Ubuntu works perfectly but on Windows 10 doesn't. I'm still new using Ubuntu for programming, but I don't know how to solve this problem, how Can I make this code works for Windows 10? I checked the code and everything looks normal for me..., do I compiled bad? or what considerations do I need to take when I'm programming on Ubuntu? Is the operating system? compiler? the way I programmed? I don't know. I hope someone can help me with this and advise me about what considerations I need to take if I want to make Ubuntu as my main operating system for programming..

19th Mar 2019, 5:55 AM
Eduardo Perez Regin
Eduardo Perez Regin - avatar
1 Antwort
0
I doubt this is SDL fault. Are you crosscompiling or compiling individually? Copy & paste won't work. Also i recommend checking Windows 10 drivers.
19th Mar 2019, 12:21 PM
Marcin Siniarski