SFML community forums

Help => General => Topic started by: polecat2016 on April 24, 2016, 08:59:38 pm

Title: SFML 2.3 with Visual Studio 2015
Post by: polecat2016 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?
Title: Re: SFML 2.3 with Visual Studio 2015
Post by: Laurent 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
Title: Re: SFML 2.3 with Visual Studio 2015
Post by: polecat2016 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.
Title: Re: SFML 2.3 with Visual Studio 2015
Post by: eXpl0it3r 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.
Title: Re: SFML 2.3 with Visual Studio 2015
Post by: polecat2016 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
Title: Re: SFML 2.3 with Visual Studio 2015
Post by: eXpl0it3r 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.