Greetings fellow developers,
i am having trouble with compiling a simple SFML Project using the command line version of Microsoft's VisualC++ Compiler. The compilation process happens inside "x64 Native Tools Command Prompt for VS 2019", which is basically a batch file provided by the visual studio 2019 installation that sets up the command line environment for me to use the cl compiler.
The problem is the following Debug Assertion Failure when running the .exe file. My folder structure is also in the following link.
https://imgur.com/a/RBcYE1MThis is the code I am compiling...
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(shape);
window.display();
}
return 0;
}
I use the following command to compile the program...
cl /I SFML-2.5.1\include main.cpp SFML-2.5.1\lib\sfml-graphics-d.lib SFML-2.5.1\lib\sfml-system-d.lib SFML-2.5.1\lib\sfml-window-d.lib
The first argument says where to look for include files. After that is the file to compile (main.cpp). The rest of the arguments are for linking the sfml dlls.
I use the SFML Version "Visual C++ 15 (2017) - 64-bit".