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

Author Topic: SFML not working with Visual Studio 2012  (Read 3863 times)

0 Members and 2 Guests are viewing this topic.

DrSulfurious

  • Newbie
  • *
  • Posts: 2
    • View Profile
SFML not working with Visual Studio 2012
« on: May 20, 2013, 10:52:38 am »
Hey, I'm in a bit of a pickle here, trying to resolve this issue with SFML-2.0.

I have rebuilt the project manually using CMAKE, and am trying to use it that way.

My issue is that when I try to compile, I get 5 linker errors. I'm confident I'm not setting up the project wrong, but I may be building the project wrong. I'm using CMAKE and build it WITHOUT static libs ticked. I'm currently linking dynamically.

Not quite sure what my issue is, I've even built it using x64 configurations (in MSVC). Anyone able to give a hand?

SLN: http://www.mediafire.com/?d8ytimwkbwtm93x
Errors: http://pastie.org/7933290

Edit: SOLVED! Read below for the answer, or read this summary:

Note: For anyone trying to find a solution to a similar issue, make sure you're building in x64 (if you're 64bit), or Win32 (for 32 bit). These settings can be found right beside the release / debug dropdown in visual studio 2012 express.
« Last Edit: May 21, 2013, 03:55:23 am by DrSulfurious »

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
Re: SFML not working with Visual Studio 2012
« Reply #1 on: May 20, 2013, 12:07:30 pm »
Is this a debug or release build?

Check you have all the correct sfml lib files (for debug/release mode) in your game's linker input settings, and that you don't have SFML_STATIC defined in your game's Preprocessor settings.

Also check that your game is set to Multi-Threaded DLL (/MD) in the Code Generation settings.

Let us know what happens.

SFML 2.1

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: SFML not working with Visual Studio 2012
« Reply #2 on: May 20, 2013, 03:20:44 pm »
Hey Dr. Sulfurious! :)

I have rebuilt the project manually using CMAKE, and am trying to use it that way.
What project have you rebuilt with CMake? SFML? If so, why? Since SFML provides binaries for VS 2012...

My issue is that when I try to compile, I get 5 linker errors. I'm confident I'm not setting up the project wrong, but I may be building the project wrong. I'm using CMAKE and build it WITHOUT static libs ticked. I'm currently linking dynamically.
The setup seems alright, my only guess is, would be, that you're trying to link against the x64 binaries with the 32bit compiler...
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

DrSulfurious

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: SFML not working with Visual Studio 2012
« Reply #3 on: May 21, 2013, 03:14:56 am »
Is this a debug or release build?

Check you have all the correct sfml lib files (for debug/release mode) in your game's linker input settings, and that you don't have SFML_STATIC defined in your game's Preprocessor settings.

Also check that your game is set to Multi-Threaded DLL (/MD) in the Code Generation settings.

Let us know what happens.

I did not have SFML_STATIC in the settings. I have all the lib files. And yes, it is set to /MD. Oh, and it's a release build.

Hey Dr. Sulfurious! :)

I have rebuilt the project manually using CMAKE, and am trying to use it that way.
What project have you rebuilt with CMake? SFML? If so, why? Since SFML provides binaries for VS 2012...

My issue is that when I try to compile, I get 5 linker errors. I'm confident I'm not setting up the project wrong, but I may be building the project wrong. I'm using CMAKE and build it WITHOUT static libs ticked. I'm currently linking dynamically.
The setup seems alright, my only guess is, would be, that you're trying to link against the x64 binaries with the 32bit compiler...
I rebuilt it because the built version for 2012 gave me the same errors, so I thought building it with my compiler would be more likely to make it work. I'll try the 32 bit binaries and report back. I'm actually not sure if my compiler is 64 bit or not. I run a 64 bit operating system, though. I also have the option to build projects in x64.

EDIT: Solution!

I wasn't building in x64 mode. Apparently I had to convert the project over! Thanks a lot guys, I appreciate the help.


« Last Edit: May 21, 2013, 03:54:23 am by DrSulfurious »