I am looking through the sfml tutorials right now, but I am having trouble because after compiling the program, it will not run properly. Visual Studio 2010 tells me that "The application was unable to start correctly(0xc015002). Note that I am running it through the debugger.
The last line in the debug prompt reads
"'Basebal sim.exe': Loaded 'C:\Users\Nick\Documents\Visual Studio 2010\Projects\Basebal sim\Basebal sim\sfml-window-d.dll', Cannot find or open the PDB file"
I already linked the following three libraries, and their appropriate .dll files are included in the application directory as well.
sfml-system-d.lib
sfml-window-d.lib
sfml-graphics-d.lib
I next tried to use the release version of the libraries instead (but still ran the program through the debugger), and the program started. Unfortunately, it wasn't long before I received a runtime error, whose cause I believe resulted from not having included the debug files, at the line sim.Clear();
I'll post my code below:
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
int main ()
{
sf::RenderWindow sim(sf::VideoMode(800, 600, 32), "Sandlot");
while (sim.IsOpened())
{
//Store any encountered events
sf::Event event;
while (sim.GetEvent(event))
{
//Close program
if (event.Type == sf::Event::Closed)
sim.Close();
}
sim.Clear();
// Build a custom convex shape
sf::Shape Polygon;
Polygon.AddPoint(0, -50, sf::Color(255, 0, 0), sf::Color(0, 128, 128));
Polygon.AddPoint(50, 0, sf::Color(255, 85, 85), sf::Color(0, 128, 128));
Polygon.AddPoint(50, 50, sf::Color(255, 170, 170), sf::Color(0, 128, 128));
Polygon.AddPoint(0, 100, sf::Color(255, 255, 255), sf::Color(0, 128, 128));
Polygon.AddPoint(-50, 50, sf::Color(255, 170, 170), sf::Color(0, 128, 128));
Polygon.AddPoint(-50, 0, sf::Color(255, 85, 85), sf::Color(0, 128, 128));
// Define an outline width
Polygon.SetOutlineWidth(10);
// Disable filling and enable the outline
Polygon.EnableFill(false);
Polygon.EnableOutline(true);
// Draw it
sim.Draw(Polygon);
//Display new screen contents
sim.Display();
}
return EXIT_SUCCESS;
}
Does anyone see the problem?