I am currently building a simple C++ game and when I try to test and run the program, it gives me an error: "(File path) is not recognized as an internal or external command" . I followed instructions from this tutorial exactly:
http://lazyfoo.net/tutorials/SDL/
I Googled this heavily and I found out that I would have to change the Environment variables, but even when I do, the program still does not execute. I don't know if I am picking the right pathway to copy and paste where the Environment Variables are located, but I tried many different pathways and I still could not get it to work.
A lot of online tutorials say I have to choose the path way of the "executable" file but I am not finding a .exe file where the program is located. Which file's pathway do I choose when putting it in the Environment Variables ? My operating system is Windows 8.1 .
Here are screenshots of me attempting to fix the problem by going Control Panel -> System and Security -> System properties -> Advanced -> Environment Variables -> Path
My code (Game.cpp):
#include "stdafx.h"
#include "Game.h"
void Game::Start(void)
{
if (_gameState != Uninitialized)
return;
_mainWindow.create(sf::VideoMode(1024, 768, 32), "Pang!");
_gameState = Game::Playing;
while (!IsExiting())
{
GameLoop();
}
_mainWindow.close();
}
bool Game::IsExiting()
{
if (_gameState == Game::Exiting)
return true;
else
return false;
}
void Game::GameLoop()
{
sf::Event currentEvent;
while (_mainWindow.pollEvent(currentEvent))
{
switch (_gameState)
{
case Game::Playing:
{
_mainWindow.clear(sf::Color(255, 0, 0));
_mainWindow.display();
if (currentEvent.type == sf::Event::Closed)
{
_gameState = Game::Exiting;
}
break;
}
}
}
}
Game::GameState Game::_gameState = Uninitialized;
sf::RenderWindow Game::_mainWindow;
Pang.cpp:
#include "stdafx.h"
#include "Game.h"
int _tmain(int argc, _TCHAR* argv[])
{
Game::Start();
return 0;
}
Build log:
'SDL2_Tutorials.exe' (Win32): Loaded 'C:\Users\satur_000\source\repos\SDL2_Tutorials\Debug\SDL2_Tutorials.exe'. Symbols loaded.
'SDL2_Tutorials.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Symbols loaded.
'SDL2_Tutorials.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Symbols loaded.
'SDL2_Tutorials.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Symbols loaded.
'SDL2_Tutorials.exe' (Win32): Loaded 'C:\Windows\SysWOW64\apphelp.dll'. Symbols loaded.
SHIMVIEW: ShimInfo(Complete)
Exception thrown at 0x77A0D4C2 (ntdll.dll) in SDL2_Tutorials.exe: 0xC000007B: %hs is either not designed to run on Windows or it contains an error. Try installing the program again using the original installation media or contact your system administrator or the software vendor for support. Error status 0x.
Unhandled exception at 0x77A0D4C2 (ntdll.dll) in SDL2_Tutorials.exe: 0xC000007B: %hs is either not designed to run on Windows or it contains an error. Try installing the program again using the original installation media or contact your system administrator or the software vendor for support. Error status 0x.
*** A stack buffer overrun occurred in "C:\Users\satur_000\source\repos\SDL2_Tutorials\Debug\SDL2_Tutorials.exe" :
This is usually the result of a memory copy to a local buffer or structure where the size is not properly calculated/checked.
If this bug ends up in the shipping product, it could be a severe security hole.
The stack trace should show the guilty function (the function directly above __report_gsfailure).
*** enter .exr 77A709A8 for the exception record
*** then kb to get the faulting stack
Unhandled exception at 0x779B9510 (ntdll.dll) in SDL2_Tutorials.exe: VTGuard instrumentation code detected an attempt to use an illegal virtual function table.
Exception thrown at 0x00000030 in SDL2_Tutorials.exe: 0xC0000005: Access violation executing location 0x00000030.
User contributions licensed under CC BY-SA 3.0