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

Author Topic: SFML Project for VS 2012  (Read 4699 times)

0 Members and 1 Guest are viewing this topic.

Clockwork

  • Newbie
  • *
  • Posts: 47
    • View Profile
SFML Project for VS 2012
« on: July 14, 2013, 11:50:07 pm »
Hello everybody!

First time poster here.  I've been looking at using SFML for a while but have never had any luck at setting it up.  I've tried time and time again to use it, but for whatever reason, it never works.  I've been using SDL for a little while now (not really that long though) and at this point I'm just curious about SFML.  Is there a project for Visual Studio 2012 Express that already has SFML set up that I can download?  Because this is just driving me crazy.
 
Thanks! :D
Clockwork

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Clockwork

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: SFML Project for VS 2012
« Reply #2 on: July 14, 2013, 11:56:49 pm »
I have tried the second tutorial, but not the first one.  I'll try that one now. Thanks!

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: SFML Project for VS 2012
« Reply #3 on: July 14, 2013, 11:57:28 pm »
You should do both in that order :)

Or you can skip the first one by downloading exploiters pre-compiled libraries for VS 2012
Edit:Though I am guessing you downloaded the ones from the official download page, and that would be the same as doing the first tutorial.

I would rather that you tell me what errors you have (Mind I live in europe so won't be able to respond until the morning here)
« Last Edit: July 15, 2013, 12:00:18 am by Groogy »
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Clockwork

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: SFML Project for VS 2012
« Reply #4 on: July 15, 2013, 12:00:48 am »
Wait, so I downloaded the SFML 2.0 file from the downloads directory that's on this website.  So do I still have to do the CMake tutorial?

Also, the one that I downloaded was the "VC++ 11 (2012) 64 Bit" so does that mean that it's for Visual Studio 2012?

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: SFML Project for VS 2012
« Reply #5 on: July 15, 2013, 12:40:15 am »
Yah you don't have to do the cmake tutorial, sorry for confusing you. I should have asked you directly "Give me whatever error or problem you get".

Yes that one is for VS 2012. (The compiler is number 11, but the IDE is called 2012)So now tell me what problem you got when you tried to follow the tutorial of how to configure with VS 2012.

Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Clockwork

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: SFML Project for VS 2012
« Reply #6 on: July 15, 2013, 02:03:59 am »
Ok, sorry I had some stuff to do and so wasn't able to reply right away.

I followed the tutorial and this is what happened.

I just used this code that I found from another tutorial:
#include <SFML/Window.hpp>
 
using namespace sf;
 
int main()
{
    VideoMode videoMode(320,240);
    Window window(videoMode,"Basic Display Window");
    window.display();
    system("PAUSE");
    window.close();
    return EXIT_SUCCESS;
}

And I get a total of 8 errors, all of which are along the lines of this:
Error   2       error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::String::~String(void)" (__imp_??1String@sf@@QAE@XZ) referenced in function _main        c:\Users\Connor\documents\visual studio 2012\Projects\SFML\SFML\Source.obj      SFML
 

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: SFML Project for VS 2012
« Reply #7 on: July 15, 2013, 02:22:50 am »
You're either mixing debug and release modes or static and dynamic linking, read the official tutorials again and carefully! :)

Also you shouldn't use using namespace sf; - it might seem convenient, but it will only make your code more unreadable and you'll essentially run into naming conflicts.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Clockwork

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: SFML Project for VS 2012
« Reply #8 on: July 15, 2013, 02:28:11 am »
Ok thanks.  I just copy pasted that from another tutorial, so not much thought went into it. 

Oh, I actually set it to All Configurations when I was adding the lib and include directories.  Should I only do the Active(Debug) and Release Directories separately?

EDIT: Oh wow! I got it to work.  I followed the tutorial really closely and I got an error that said I was using the wrong set of SFML (I was using 64 bit, I should have used 32 bit... ) and now it works!

Thanks for the help! :D
« Last Edit: July 15, 2013, 04:42:02 am by Clockwork »

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: SFML Project for VS 2012
« Reply #9 on: July 15, 2013, 12:46:37 pm »
Yeah, I shouldn't have confused you and just asked you to give us the error and it would have went a lot quicker ;)
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

 

anything