SFML community forums

Help => General => Topic started by: Neobeum on June 04, 2015, 09:55:31 am

Title: Error - Graphics/Window - Static Lib
Post by: Neobeum on June 04, 2015, 09:55:31 am
Hello
I am new to programming, but I have gotten SFML working on a few other projects before.

When I tried updating via GitHub and making a CMake Project, I received errors during my build. So I decided to download the Zip from http://www.sfml-dev.org/download/sfml/2.3/

32Bit - VS2013.

I have linked the libraries exactly how I had done before, and included the SFML_STATIC macro.

However I get this error. As you can see, it's not even building anything other than a window, but there are some referrences to the Texture.cpp.obj in the error list.

(http://i.imgur.com/Hm9VB6R.png)

here's a screenshot of my program window working before I started the update.

(http://i.imgur.com/0159mRy.jpg)

Thanks in advance. Hopefully I didn't screw anything up. I've only been programming for about 3 months.
Title: Re: Error - Graphics/Window - Static Lib
Post by: AlexAUT on June 04, 2015, 10:00:20 am
I think you forgot to link the dependencies of SFML. Since 2.2, or 2.1? can't remember exactly, when linking SFML statically you have to link the dependencies yourself. Here is a list of all dependencies: http://www.sfml-dev.org/tutorials/2.3/start-vc.php


AlexAUT
Title: Re: Error - Graphics/Window - Static Lib
Post by: Neobeum on June 04, 2015, 04:40:28 pm
here's a cropped and highlighted version of the screenshot above. i've linked the -s-d.lib files.

(http://i.imgur.com/nFqQn1N.png)


i'll try and play around with it again and maybe go back down a version if i can't get 2.3 working
Title: Re: Error - Graphics/Window - Static Lib
Post by: eXpl0it3r on June 04, 2015, 04:59:58 pm
Is it so hard to read the static linking part of the SFML 2.3 tutorial? Don't read the 2.2 or 2.1 or 2.0 tutorial, there have been changes and they are only in the 2.3 tutorial. The changes are that you have to link the dependencies now as well.
Title: Re: Error - Graphics/Window - Static Lib
Post by: G. on June 04, 2015, 05:00:12 pm
Read the tutorial.
You're missing SFML dependencies, it's necessary to link them if you want to link SFML statically.
Title: Re: Error - Graphics/Window - Static Lib
Post by: Neobeum on June 04, 2015, 05:05:05 pm
The CMake Github build and the 2.3 Zip file didn't contain the opengl32.lib
Title: Re: Error - Graphics/Window - Static Lib
Post by: eXpl0it3r on June 04, 2015, 05:20:33 pm
They come with your toolchain. ::)
It's all written there.
Title: Re: Error - Graphics/Window - Static Lib
Post by: epitaque on June 11, 2015, 12:48:57 am
It's happening to me too -  I think it is for different reasons though since I included all of the dependencies. If you wouldn't mind letting me know what I did wrong (I know you get hundreds of these posts about linking) it would be greatly appreciated. I've successfully statically linked SFML 2.2 in the past but SFML 2.3 seems to be giving me issues with the Debug part. (The release one works perfectly) I am using Visual Studio 13 and 64 bit SFML. Here are all the settings:
All Configurations->Configuration Properties->VC++ Directories->Include Directories:
(click to show/hide)
All Configurations->Configuration Properties->VC++ Directories->Library Directories:
(click to show/hide)
Release->Configuration Properties->Linker->Additional Dependencies:
(click to show/hide)
Debug->Configuration Properties->Linker->Additional Dependencies:
(click to show/hide)
Console log:
(click to show/hide)
Title: Re: Error - Graphics/Window - Static Lib
Post by: SpeCter on June 11, 2015, 11:46:29 pm
Did you define SFML_STATIC? If not, read the tutorial carefully again.
And is there any reason for using the 64 Bit sfml libraries?
Title: Re: Error - Graphics/Window - Static Lib
Post by: epitaque on July 06, 2015, 08:17:31 pm
Yes, I did.
In SFML 2.2 the 32 bit binaries did not work for me, so I used the 64 bit ones, which did work. I figured the same might happen in 2.3, but now the Debug part doesn't work.

Edit: Downloaded SFML for Visual C++ 12 (2013) - 64-bit again, and this time it worked.
Edit: It only worked because I set the debug configuration to use the Release configuration
Edit: Tried 32 bit version. Same thing happened - the Release configuration works but the debug configuration does not. Will try to learn how to use CMake tomorrow and see if building it myself works.