Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon

Compiling Pang for release and distribution



This entire tutorial series made use of Debug build libraries.  This quick section covers the process of actually rebuilding Pang using release libraries.



The first thing you need here is DLLs compiled for Visual Studio 2010 with the EXACT same settings as your project.  If you decide to build them yourself, make sure you download the most recent freetype library, trust me on this!  Otherwise you can download my precompiled SFML 1.6 multithreaded DLLs right here.


If you are using SFML 2.0, you can find instructions here as the build process has changed a bit. 



We need a project to work on, I am going to use Pang9, as it is the most current release as of writing.  If you already have a project, skip this part, otherwise download Pang9 now and extract the archive somewhere.



Now load up your project, this process is going to be remarkably similar to the configuration I part 1, so if you are getting a feeling of déjà vu, that is why!



Right click on your Project and select Properties.  We want to change to Release mode, as such:






Now on the left hand side, locate C++ and set the Additional Include Directory, as such:





I configured all the of the projects to include SFML relative to the project root, if you located SFML somewhere else, you will need to change this path directory.  Now we need to configure the linker directory.  On the left had side, expand Linker and select general.  We then want to add SFML1-6/lib to Additional Library Directories, like this:






Now select “Input” on the left hand side, on the right click Additional Dependencies, so the drop down icon appears, like this:




Click Edit, then add the following libraries:




That’s sfml-system.lib, sfml-main.lib, sfml-graphics.lib, sfml-audio.lib, sfml-network.lib and sfml-window.lib.



You should now be able to compile your project in release without issue.  Switch into Release mode and then CTRL+SHIFT+B to build all.





There is one last step however, we need to copy our DLLs into our release folder.  From the archive you downloaded earlier ( ), extract the contents into your release folder.





Now copy them into (Project Root)\Release, so it should look something like this:





Now assuming you actually want to distribute your game and not just run it inside of Visual Studio, you also need the data files.  In the project root, copy the folders audio and images.






Paste both of these in your release directory as well.



Now double click Pang.exe, and if all things worked correctly, it should load and play fine.  Now if you want to distribute your game, all you need to distribute is the contents of the Release folder.  You can delete all .obj, lib, log, pdb and tlog files, they do not need to be included in the release.  Here is the bare minimum contents that need to be shipped with your application:





Additionally, if they don’t already have it, they will need the Visual C++ redistributable, which can be downloaded here

blog comments powered by Disqus

See More Tutorials on!

Month List

Popular Comments