Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML 2.1 Visual Studio 2013 binaries + source + template  (Read 65709 times)

0 Members and 1 Guest are viewing this topic.

Fitzy

  • Newbie
  • *
  • Posts: 15
    • View Profile
    • Email
SFML 2.1 Visual Studio 2013 binaries + source + template
« on: September 19, 2013, 03:11:31 am »
Visual Studio 2013 Binaries + Source

Download: https://dl.dropboxusercontent.com/u/88413086/SFML-2.1-VS2013-RC.rar
There 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:

Quote
#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 VIEWS

Visual Studio 2013 RC Template

Download: https://dl.dropboxusercontent.com/u/88413086/SFML%20Game%20Template.rar

This template has the above SFML_STATIC code snippet and the official SFML code snippet from the
official green circle installation test code.

Installation Instructions

Make 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\bin

Now 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:

Quote
#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.
« Last Edit: September 19, 2013, 08:01:10 pm by Fitzy »

georgewbw

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: SFML 2.1 Visual Studio 2013 binaries + source + template
« Reply #1 on: October 09, 2013, 08:11:49 pm »
Logged in to let you know your project template is working. Thank you for sharing, you saved me some time (:

Unreliable

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Re: SFML 2.1 Visual Studio 2013 binaries + source + template
« Reply #2 on: October 29, 2013, 03:47:35 pm »
Followed your instructions and it worked perfectly! Thanks so much!

sylvain

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: SFML 2.1 Visual Studio 2013 binaries + source + template
« Reply #3 on: November 11, 2013, 10:11:15 am »
I followed the instructions, and it works with debug static / release / release static.
However, in debug mode I get an error message: "Unable to start program 'C:\Users\Sylvain\Documents\Visual Studio 2013\Projects\SFMLGame1\Debug\SFMLGame1.exe'.  The system cannot find the file specified."
Do you know why? Thanks


JGrieco42

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: SFML 2.1 Visual Studio 2013 binaries + source + template
« Reply #4 on: November 15, 2013, 12:47:43 am »
I struggled a ton with VS2013 today, probably wasted almost 2 hours on this.  Your template is amazing, can't thank you enough!

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: SFML 2.1 Visual Studio 2013 binaries + source + template
« Reply #5 on: November 15, 2013, 08:24:22 am »
I followed the instructions, and it works with debug static / release / release static.
However, in debug mode I get an error message: "Unable to start program 'C:\Users\Sylvain\Documents\Visual Studio 2013\Projects\SFMLGame1\Debug\SFMLGame1.exe'.  The system cannot find the file specified."
Do you know why? Thanks
He probably set a different path for execution and for building the binary, just go through the settings and make sure the path point to the same location. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Grimlen

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • Email
Re: SFML 2.1 Visual Studio 2013 binaries + source + template
« Reply #6 on: November 18, 2013, 08:09:34 pm »
Can someone help?
I did everything he said, I downloaded the template as well.
Opened it up, it ran completely fine in both Debug and Release.

However I have a problem.
I'm trying to make a WIN32 project and getting VS 2013 to work with SFML 2.1.

I can't get it to work with a WIN32 project.
I'm not sure what else he has in the templates property pages.
The only difference I found was the includes:

C:\SFML\SFML-2.1\include;%(AdditionalIncludeDirectories)
C:\SFML\SFML-2.1\Libs\Release;%(AdditionalLibraryDirectories)

I'm simply trying to get the Audio portion of SFML working with Visual Studio 2013 Ultimate edition.

Now seeing that the template project works smoothly, this shows that I've successfully copied the SFML dlls to the VC/bin folder correctly.

The WIN32 project just doesn't work.
Here are the libs I've included in my win32 project property pages:
sfml-system-d.lib;sfml-window-d.lib;sfml-audio-d.lib;

When I try to build and run it, I get an error:

"The program can't start because MSVCP110D.dll is missing from your computer. Try reinstalling the program to fix this problem."

I'm unsure of why I'm getting this error.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: SFML 2.1 Visual Studio 2013 binaries + source + template
« Reply #7 on: November 18, 2013, 09:41:31 pm »
No need to post in two different places as you did in this thread. Your problem might be coming from the fact that the OP was built using VS 2013 RC, not the actual release of VS 2013. What I suggest you do is follow the official tutorials to build SFML from the source using your compiler.
« Last Edit: November 19, 2013, 03:46:21 pm by zsbzsb »
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Fitzy

  • Newbie
  • *
  • Posts: 15
    • View Profile
    • Email
Re: SFML 2.1 Visual Studio 2013 binaries + source + template
« Reply #8 on: November 22, 2013, 04:29:50 pm »
No need to post in two different places as you did in this thread. Your problem might be coming from the fact that the OP was built using VS 2013 RC, not the actual release of VS 2013. What I suggest you do is follow the official tutorials to build SFML from the source using your compiler.

That's not the issue, I'm using my same method on the full release of VS2013 the template I provided was for a console application. I should have mentioned this I'm really sorry to have wasted your time. It's probably best to do what zsbzsb said and just rebuild the source with CMake and follow the install guide on this site.

My method was just meant to be a shortcut to save time on the VS2013 RC but works on VS2013 Ultimate too.

Xafi

  • Newbie
  • *
  • Posts: 18
  • My project, http://1ndieidea.hol.es/
    • View Profile
Re: SFML 2.1 Visual Studio 2013 binaries + source + template
« Reply #9 on: November 29, 2013, 01:22:20 pm »
Working

clark

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: SFML 2.1 Visual Studio 2013 binaries + source + template
« Reply #10 on: January 12, 2014, 08:04:32 pm »
Hey everyone.

There is a few threads about this, I have seen the CMake tutorial and things start to break down a little. I am new to C++ / Visual Studio / SFML and the additional build step is tripping me up.

I see there is VS10 and VS11 does anyone know when there will be an official VS12 build for download?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
AW: SFML 2.1 Visual Studio 2013 binaries + source + template
« Reply #11 on: January 12, 2014, 08:27:43 pm »
With SFML 2.2 which will be released when the iOS and Android bits are tested enough and stable enough.
An ETA? SOON (TM)! ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

clark

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: SFML 2.1 Visual Studio 2013 binaries + source + template
« Reply #12 on: January 12, 2014, 08:33:07 pm »
Thanks for that mate!  Still getting the layout of the land. I will look forward to 2.2 :D Think I might try VS11 in the mean time. Lol, my boss got the response "SOON" on Friday, I am down with that timeframe.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Mustache

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: SFML 2.1 Visual Studio 2013 binaries + source + template
« Reply #14 on: January 14, 2014, 12:33:37 pm »
I've been stopped game programming because there was no nice template. Because my lazy butt I did not see this topic! Thank you so much, I'm back programming games. :D