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

Author Topic: Setting SFML up in VC 2013  (Read 3272 times)

0 Members and 1 Guest are viewing this topic.

SlySherZ

  • Newbie
  • *
  • Posts: 13
    • View Profile
Setting SFML up in VC 2013
« on: June 13, 2014, 05:01:34 pm »
Hey guys. I spent more than 2 hours already trying to install SFML so... I decided to call for help.

I followed the tutorial (at least I think I did): got the source, ran CMake on it, and finally compiled INSTALL project.

New project -> setting everything up as requested and...
Error   1   error LNK1104: cannot open file 'sfml_audio-d.lib'

I checked the project definitions more than 20 times already. I tried to change Linker->Additional Directories to every folder on my pc that as that library, no success :S
Already tried to start from scratch, use different definitions on CMake, still not working.

Thanks!
« Last Edit: June 19, 2014, 02:42:09 am by SlySherZ »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11029
    • View Profile
    • development blog
    • Email
Re: Setting SFML up in VC 2013
« Reply #1 on: June 13, 2014, 05:03:23 pm »
New project -> setting everything up as requested and...
Error   1   error LNK1104: cannot open file 'sfml_audio-d.lib'
Either it's a tyop on the post, or you didn't really try hard enough reading the tutorial. ;)

It's obviously sfml-audio-d.lib and "cannot open file" means can not find the file.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

SlySherZ

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Setting SFML up in VC 2013
« Reply #2 on: June 13, 2014, 05:05:22 pm »
Well... the problem is that it should be able to find it, because I added it's location to Additional Libraries on Linker settings.

select_this

  • Full Member
  • ***
  • Posts: 130
  • Current mood: just ate a pinecone
    • View Profile
    • darrenferrie.com
Re: Setting SFML up in VC 2013
« Reply #3 on: June 13, 2014, 05:07:53 pm »
Well... the problem is that it should be able to find it, because I added it's location to Additional Libraries on Linker settings.

sfml_audio-d.lib does not equal sfml-audio-d.lib. Note that yours has an underscore and the correct version has a hyphen...
Follow me on Twitter, why don'tcha? @select_this

SlySherZ

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Setting SFML up in VC 2013
« Reply #4 on: June 13, 2014, 05:11:37 pm »
Oh... what a stupid mistake!
Thank you very much ;)

Well, after testing my program, I'm getting a lot of dll missing errors.
It compiles, but I get an error right after saying that OpenAl is missing. I installed OpenAl and now libsndfile-1.dll is missing. Did I forget something?
« Last Edit: June 13, 2014, 05:26:23 pm by SlySherZ »

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Setting SFML up in VC 2013
« Reply #5 on: June 13, 2014, 06:17:47 pm »
Quote
I installed OpenAl and now libsndfile-1.dll is missing. Did I forget something?

Where did the tutorial say to install OpenAl?

To quote from the tutorial which you should be reading...

Now compile the project, and if you linked to the dynamic version of SFML, don't forget to copy the SFML DLLs (they are in <sfml-install-path/bin>) to the directory where your compiled executable is.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Salva_R

  • Newbie
  • *
  • Posts: 5
    • View Profile

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Setting SFML up in VC 2013
« Reply #7 on: June 13, 2014, 08:55:39 pm »
Hey, try this tutorial:
keepingupwithcode.wordpress.com/2013/11/11/getting-sfml-and-others-set-up-with-visual-studio-2013/

Please don't be posting links to tutorials unless they are actually good. Just taking a quick look through that link I can tell you already it omits information and gives false information.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Salva_R

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Setting SFML up in VC 2013
« Reply #8 on: June 13, 2014, 09:10:39 pm »
Hey, try this tutorial:
keepingupwithcode.wordpress.com/2013/11/11/getting-sfml-and-others-set-up-with-visual-studio-2013/

Please don't be posting links to tutorials unless they are actually good. Just taking a quick look through that link I can tell you already it omits information and gives false information.



Sorry, I don't mean to spread bad information; I linked it because I was having pretty much the same problems and that tutorial worked like a charm, I'll delete the comment if you find it appropiate.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Setting SFML up in VC 2013
« Reply #9 on: June 13, 2014, 10:02:02 pm »
Sorry, I don't mean to spread bad information; I linked it because I was having pretty much the same problems and that tutorial worked like a charm, I'll delete the comment if you find it appropiate.

That is not needed, but you should know that the biggest thing wrong with that article is that it explicitly says to use VS11 binaries with VS 12 which is totally wrong.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

SlySherZ

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Setting SFML up in VC 2013
« Reply #10 on: June 13, 2014, 11:06:54 pm »
Thanks a lot  for your help guys! I didn't know I had to add those 2 static libraries to the .exe folder.

One more problem (hopefully the last one I need help to solve): when I try to the draw() function

Window.draw(text);

I get a linking error:    error LNK2001: unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)

everything else is working fine, I don't know what's wrong ...

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11029
    • View Profile
    • development blog
    • Email
Re: Setting SFML up in VC 2013
« Reply #11 on: June 13, 2014, 11:13:06 pm »
Sounds like you're mixing debug and release modes. Or mixing static and dynamic linking.

Did you by any chance define SFML_STATIC while linking against dynamic libraries?
« Last Edit: June 13, 2014, 11:15:37 pm by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

SlySherZ

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Setting SFML up in VC 2013
« Reply #12 on: June 13, 2014, 11:30:17 pm »
I did. I don't really understand what dynamic and static means, so I'll check it out on the internet to see if I understand what I'm doing wrong

Btw I tried to change the properties of the project to have the the release dll's linked with the release version and the -d ones linked with the debug version. I get the same error on both

EDIT: From what I understood static means you have an exe doing everything, dynamic means you have dll + exe. For this project I do prefer static so I'll check if everything is set to static.

EDIT2: I'm getting an error by compiling INSTALL after setting everything up for static in CMake, so... I'll try to make it Dynamic instead xD

EDIT3: IT WORKED! You guys are my heroes :D
« Last Edit: June 13, 2014, 11:48:18 pm by SlySherZ »

 

anything