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

Author Topic: SFML 2.3 with Visual Studio 2015  (Read 1507 times)

0 Members and 1 Guest are viewing this topic.

polecat2016

  • Newbie
  • *
  • Posts: 3
    • View Profile
SFML 2.3 with Visual Studio 2015
« on: April 24, 2016, 08:59:38 pm »
Hi,

I recently moved from development on OSX to development on Windows (Win10). I have VS2015 installed, but I can't seem to import the SFML libraries. When I select "Add Reference," there's no browse option so I can't select the SFML DLLs. I tried using includes such as  #include "C:\\...\\SFML-2.3.2\\include\\SFML\\Graphics.hpp" but it just results in more errors ("Cannot open source "\\SFML\Window.hpp"). How do I integrate SFML into VS? Do I have to build it first?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML 2.3 with Visual Studio 2015
« Reply #1 on: April 24, 2016, 09:08:17 pm »
Don't try random stuff... just read the tutorial.

http://www.sfml-dev.org/tutorials/2.3/start-vc.php
Laurent Gomila - SFML developer

polecat2016

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: SFML 2.3 with Visual Studio 2015
« Reply #2 on: April 24, 2016, 09:27:44 pm »
Thanks much for your quick reply. I followed the tutorial for dynamic linking and I get the runtime error "The program cant stat because sfml-XX-2.dll is missing" where XX is the specific modules e.g. system, graphics, etc. If I try the static linking options I get linker errors even after changing to the *-s.lib file references.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: SFML 2.3 with Visual Studio 2015
« Reply #3 on: April 24, 2016, 09:53:57 pm »
From the linked tutorial...

Quote
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.
If you are using the sfml-audio module (regardless whether statically or dynamically), you must also copy the DLL of the external library needed by it, which is OpenAL32.dll.
These files can be found in <sfml-install-path/bin> too.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

polecat2016

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: SFML 2.3 with Visual Studio 2015
« Reply #4 on: April 24, 2016, 10:05:44 pm »
I copied the DLLs to both $ProjDir/(ProjName) and $ProjDir/Debug and got the same result. I'm going to try building SFML myself and see if that works

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: SFML 2.3 with Visual Studio 2015
« Reply #5 on: April 24, 2016, 11:05:23 pm »
Well if you place the DLLs next to the exe (which you're actually running), then it should find them. If not, you're doing something, somewhere wrong. For example accidentally running the release build instead or not having provided the debug libraries for the debug build, etc.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything