Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon


9. March 2012

 EDIT: DO not use the included binaries, instead look at the link from the Pang tutorial series to your right!

 

I have gotten a few emails or messages on this topic, enough so that I figure I will put together a post on the subject.  In my PANG! SFML C++ game tutorial, I show how to configure for debug builds but not release.

 

 

So, first and foremost, you are going to need to compile SFML 1.6 for release mode if you don’t already have the release libraries.  You can either download the SFML 1.6  source code here and compile them for release, in either DLL or static mode.  To do so, in Visual Studio 2010 after importing the project ( from SFML-1.6\build\vc2008 ) go ahead and delete the samples folder in the Solution Explorer. Then select the Build Menu, go to the Configuration Manager, then select the build you want to make:

 

Untitled

 

 

You either want to build Release DLL or Release Static, depending on if you are compiling static or dynamic.  If that is completely alien to you what the difference is, dynamic means you will ship the SFML Dll’s with your application, which will contain the SFML related code.  Static on the other hand, will compile all of the SFML related code into your EXE file, making it quite large but easier to distribute.  Either works, but if you ran into the dreaded ATI bug, static fixes it.  On the other hand, if you don’t use all parts of the SFML library, dynamic can be a whole lot smaller.

 

 

If you can’t be bothered building the DLLs, I have compiled them for you.  This archive contains the .lib/dll files for both static and dll versions of SFML compiled for Visual Studio 2010.

 

 

Now that you have the proper lib and dll files, the instructions are basically identical to this part of the tutorial.   The only thing you have to do different is, when in your projects properties before adding libraries, you need to select Release Build.

 

image

 

 

Also, when you specify the library names, you do not include –d at the end.  So for example, instead of adding sfml-system-d.lib, you add sfml-system.lib.  Repeat this for each library.

 

Now you should be able to build the release version of your game without problem.  This again is accomplished using Build->Configuration Manager, like so:

 

image

 

 

Simply switch to release rebuild and done.

Programming

blog comments powered by Disqus

Month List

Popular Comments