SFML community forums

General => General discussions => Topic started by: Sarbast on May 12, 2014, 03:59:15 pm

Title: Setup SFML on VS 2013 professional
Post by: Sarbast on May 12, 2014, 03:59:15 pm
Hi
its been three days i can't still mange to setup SFML 2.1
please help me
(http://s30.postimg.org/o4b65bvkx/HKDHS.png)
Title: Re: Setup SFML on VS 2013 professional
Post by: zsbzsb on May 12, 2014, 04:04:19 pm
If you downloaded the precompiled libs from the main site they will not work since they are for VS 2012. Either compile SFML yourself or grab the nightlies from here (http://www.nightlybuilds.ch/).
Title: Re: Setup SFML on VS 2013 professional
Post by: Sarbast on May 12, 2014, 04:07:29 pm
i'm newbie i never used any API before
could please direct me to the tutorial
Title: Re: Setup SFML on VS 2013 professional
Post by: eXpl0it3r on May 12, 2014, 04:19:12 pm
The CMake tutorial is here (http://www.sfml-dev.org/tutorials/2.1/compile-with-cmake.php).

My Nightly Builds are just like the SFML packages, so you just remove your current libraries and use mine instead.
Title: Re: Setup SFML on VS 2013 professional
Post by: Sarbast on May 12, 2014, 04:32:14 pm
i downloaded Nightly SFML for x64
but now i have system type error :-\
Error   1       error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'       c:\Users\Sarbast\documents\visual studio 2013\Projects\SFMLs\sfml-graphics-d.lib(sfml-graphics-d-2.dll) SFMLs
 
Title: AW: Setup SFML on VS 2013 professional
Post by: eXpl0it3r on May 12, 2014, 04:35:50 pm
If you use the 64 bit libraries, you'll also have to use the 64 bit compiler.
If you don't find the setting, google for it. ;)
Title: Re: Setup SFML on VS 2013 professional
Post by: Sarbast on May 12, 2014, 04:42:39 pm
fixed it
now i have another one
the program can't start because sfml-graphics-2.dll missing from your computer
how can i link the DLL files?
i forgot to add SFML_STATIC :D
well another error  :'(

Error   1       error LNK2001: unresolved external symbol "public: static class sf::Color const sf::Color::Green" (?Green@Color@sf@@2V12@B)     C:\Users\Sarbast\documents\visual studio 2013\Projects\SFMLs\main.obj   SFMLs
Error   2       error LNK2001: unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)    C:\Users\Sarbast\documents\visual studio 2013\Projects\SFMLs\main.obj   SFMLs
Error   3       error LNK1120: 2 unresolved externals   C:\Users\Sarbast\documents\visual studio 2013\Projects\SFMLs\Debug\SFMLs.exe    1       1       SFMLs
 
Title: AW: Setup SFML on VS 2013 professional
Post by: eXpl0it3r on May 12, 2014, 05:18:25 pm
Read the official tutorial. DLLs don't get linked. You just need to copy them next to your executable.
Title: Re: Setup SFML on VS 2013 professional
Post by: Sarbast on May 12, 2014, 05:52:48 pm
I really tired it won't work :(
Title: Re: Setup SFML on VS 2013 professional
Post by: magneonx on May 12, 2014, 06:01:09 pm
Hi also encountered that very same error. What I did is that I replaced SFML_STATIC with SFML_DYNAMIC. Currently is still don't know the difference, but I do understand what static and dynamic means but not just on the API building from source stuff. But anyway in case you need help maybe replacing SFML_STATIC with SFML_DYNAMIC should work? It did work for me. I built SFML from source from the very master file in GitHub, I plan to use SFML with Thor.

I hope this helps :)/
Title: Re: Setup SFML on VS 2013 professional
Post by: Sarbast on May 12, 2014, 06:07:05 pm
it worked magneonx  :o
i want to thank you 1 million times man you saved me  :-*
i was about to give up and start downloading SDL
Title: Re: Setup SFML on VS 2013 professional
Post by: eXpl0it3r on May 12, 2014, 06:13:28 pm
Those that can read have clearly an advantage... ::)
If you just look at images and randomly type what's written there, you'll obviously run into issues. SFML_STATIC is - what a surprise - for static libraries and as the tutorial states, those are the ones with the -s suffix. So if you define SFML_STATIC and link the ones without the -s suffix, you'll obviously get errors...

SFML_DYNAMIC doesn't exist anymore and as such doesn't need to be specified.
Title: Re: Setup SFML on VS 2013 professional
Post by: Sarbast on May 12, 2014, 07:29:14 pm
i don't whats the problem with SFML_STATIC;
but here the steps
1-download SFML2.1 at Nightly and extract to c:\data

2-make an empty project and add a source.cpp

3-link C:\data\SFML-VS12x32\include and C:\data\SFML-VS12x32\lib

4- add Add the following libraries for statically
sfml-graphics-s-d.lib
sfml-audio-s-d.lib
sfml-system-s-d.lib
sfml-window-s-d.lib
sfml-network-s-d.lib

Add the following libraries for dynamically

sfml-graphics-d.lib
sfml-audio-d.lib
sfml-system-d.lib
sfml-window-d.lib
sfml-network-d.lib

5- add SFML_STATIC


i don't know whats more i should do :-\
Title: Re: Setup SFML on VS 2013 professional
Post by: G. on May 12, 2014, 09:49:22 pm
Maybe https://github.com/SFML/SFML/wiki/FAQ#build-link-static
Title: Re: Setup SFML on VS 2013 professional
Post by: binary1248 on May 12, 2014, 10:07:25 pm
What is your native language? Just wanted to know in case we go ahead and translate the tutorial into more languages in the future.

I think it is more or less clear from the tutorial that you should select one link type, either static or dynamic, not both. Obviously, you should only define SFML_STATIC if you choose to link statically. It doesn't make sense to define SFML_STATIC if you link dynamically does it? Also, there is no more SFML_DYNAMIC, not for the last 3 years. Not defining SFML_STATIC implies dynamic linking. Whoever suggests defining SFML_DYNAMIC to solve issues just resorted to trial and error rather than trying to understand and systematically solve the problem.
Title: Re: Setup SFML on VS 2013 professional
Post by: Sarbast on May 12, 2014, 10:56:22 pm
worst language ever there is only one c# tutorial and a little about web designing :D
btw its Kurdish

i tried to use static but i had no chance to get it works
i did same as written http://www.sfml-dev.org/tutorials/2.1/start-vc.php

i would be if someone login into my laptop through TeamViewer
Title: Re: Setup SFML on VS 2013 professional
Post by: theindy on May 13, 2014, 01:37:26 pm
What is the compiler error message?

Did you get the precompiled static libraries or are you using the dynamic ones now? Have you paid attention to the different configurations for linking the debug build version with the debug type libs and vice versa with the release configuration?
Title: Re: Setup SFML on VS 2013 professional
Post by: Sarbast on June 03, 2014, 10:41:28 pm
here is the video i made of how i tried to build it for VS2013 but the static not works
https://www.youtube.com/watch?v=a2HvDgFhnYs&feature=youtu.be

i hope someone help me  :(