Visual Studio 2013 Binaries + SourceDownload: https://dl.dropboxusercontent.com/u/88413086/SFML-2.1-VS2013-RC.rarThere we be an installation tutorial for this setup at the bottom of the post.Here are the Binaries for VS2013 RC, this will also work for VS2013 Preview.
I had to make some changes to the static libraries because CMake was giving
me errors linking the 'libs' incorrectly causing syntax errors "&
quot".
The way to bypass this issue was to link the libs for static builds implicitly like:
#ifdef SFML_STATIC
#pragma comment(lib, "glew.lib")
#pragma comment(lib, "freetype.lib")
#pragma comment(lib, "jpeg.lib")
#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "winmm.lib")
#pragma comment(lib, "gdi32.lib")
#endif // SFML_STATIC
As long as SFML_STATIC is in the pre-processor in the project settings for the static build
these libs will link flawlessly. I know it's bad practice but I find explicitly calling them like this
much cleaner and the programmer can see exactly what's happening in their project.
THIS IS PURELY MY OWN OPINION AND YOU ARE NOT EXPECTED TO FOLLOW MY VIEWSVisual Studio 2013 RC TemplateDownload: https://dl.dropboxusercontent.com/u/88413086/SFML%20Game%20Template.rarThis template has the above SFML_STATIC code snippet and the official SFML code snippet from the
official green circle installation test code.
Installation InstructionsMake sure you're using Visual Studio 2013
Preview or
RC(Release Candidate) and Winrar!
1. Start by extracting the Binaries folder to your
C:/ drive.
So it appears like this:
C:\SFML\SFML-2.1 IT IS IMPORTANT YOU COPY IT TO THE C:/ OTHERWISE THE PROJECT SETTINGS WILL BE MESSED UP!2. Then extract the template file to your Visual Studio path
Microsoft Visual Studio 12.0\VC\vcprojects Mine appears like:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcprojects It should now have a new folder in there named SFML Game and inside the folder it should have the files.
3. Now go to the
C:\SFML\SFML-2.1 folder and open the bin folder, you should see loads of .dll files, this is perfect!
We need to copy all of these .dll files and copy them into the Visual Studio 2013 bin folder so when we
run our project it will be able to find the runtime components our program needs to run!
Copy all of those .dll files to:
Microsoft Visual Studio 12.0\VC\bin Again, mine looks like this:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\binNow fire up Visual Studio 2013 and start a new project, click on Visual C++, you should now see SFML Game!
Open this and open SFML Game project file and call it what you like. You should now see the following:
#ifdef SFML_STATIC
#pragma comment(lib, "glew.lib")
#pragma comment(lib, "freetype.lib")
#pragma comment(lib, "jpeg.lib")
#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "winmm.lib")
#pragma comment(lib, "gdi32.lib")
#endif // SFML_STATIC
#include <SFML/Graphics.hpp>
//Default test code from the SFML website
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;
}
You now have 4 compiling options.
- Debug
- Debug Static
- Release
- Release Static
Try each of these settings and build the sample code, vuala! We hopefully have lift off!
Small edit to correct the version, it's SFML 2.1! not 2.0 - Sorry.