SFML community forums

Help => General => Topic started by: adomas on January 22, 2016, 07:56:43 pm

Title: SFML on VC++ 2015 (x64)
Post by: adomas on January 22, 2016, 07:56:43 pm
Hello,
I have this strange issue. I use SFML 2.3.2 on Visual Studio Enterprise 2015. With Win32 (x86) configuration everything is OK, but when I try to compile on x64 I get errors. I use shared configurations and accordingly 32bit or 64bit SFML. On 64bit Release I get these Linker errors:

Severity   Code   Description   Project   File   Line   Suppression State
Error   LNK2001   unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)   GameTest103   D:\Workbench\Software\Dev\GameTest103\GameTest103\main.obj   1   
Error   LNK2001   unresolved external symbol "public: static class sf::Color const sf::Color::Green" (?Green@Color@sf@@2V12@B)   GameTest103   D:\Workbench\Software\Dev\GameTest103\GameTest103\main.obj   1   

How to I solve this? I use Console subsystem on both. x86 compiles fine with 32bit SFML and runs smoothly. But does not compile and link in x64 version and with 64bit SFML. What to do? Might be an error for SFML 2.3.2 VC++ 14 (2015) 64bit? BTW running Windows 10 Enterprise 64bit
Title: SFML on VC++ 2015 (x64)
Post by: eXpl0it3r on January 22, 2016, 10:23:25 pm
You must have defined SFML_STATIC even though you use dynamic libs. ;)
Title: Re: SFML on VC++ 2015 (x64)
Post by: adomas on January 23, 2016, 05:18:27 pm
I tried to define SFML_STATIC, but it did not help, I still get same error. I also tried using static libs, but I got even more linker errors. Any ideas?
Title: Re: SFML on VC++ 2015 (x64)
Post by: Hapax on January 23, 2016, 07:05:12 pm
I tried to define SFML_STATIC, but it did not help
You must have defined SFML_STATIC
This means that you did define it but you shouldn't (when linking dynamically).
Title: Re: SFML on VC++ 2015 (x64)
Post by: adomas on January 24, 2016, 07:20:23 pm
Linker error does not change, with SFML_STATIC defined and not defined. It does not have impact on error :(
Title: SFML on VC++ 2015 (x64)
Post by: eXpl0it3r on January 24, 2016, 07:45:07 pm
Post your full build command (http://www.sfml-dev.org/faq.php#tr-grl-verbose-ide) then.
Title: Re: SFML on VC++ 2015 (x64)
Post by: Raneman on January 25, 2016, 03:02:14 am
Or just use -d.dll's
Title: Re: SFML on VC++ 2015 (x64)
Post by: zsbzsb on January 25, 2016, 01:52:36 pm
Or just use -d.dll's

-d indicates debug libs, not dynamic.
Title: Re: SFML on VC++ 2015 (x64)
Post by: Raneman on January 27, 2016, 02:51:15 pm
-s.dlls ofc, my mistake.
Title: Re: SFML on VC++ 2015 (x64)
Post by: Rosme on January 29, 2016, 04:04:06 pm
There are no -s.dll since -s indicate static, and it's only on the .lib. Please inform yourself before saying false stuff(twice).