SFML community forums

Help => General => Topic started by: Wqer on January 14, 2014, 06:52:32 am

Title: Static Linking
Post by: Wqer on January 14, 2014, 06:52:32 am
.
Title: AW: Static Linking
Post by: eXpl0it3r on January 14, 2014, 07:44:41 am
Did you read the tutorial? Have you defined SFML_STATIC?
Without the actual error we can't help you....
Title: Re: Static Linking
Post by: eXpl0it3r on January 14, 2014, 09:40:07 pm
These tutorials (http://www.sfml-dev.org/tutorials/2.1/) also have a look at the FAQ (https://github.com/SFML/SFML/wiki/FAQ).
Title: Re: Static Linking
Post by: Xornand on January 16, 2014, 07:07:38 am
If you're using the latest version from the repository, then you also need to link against the SFML's dependencies, i.e. OpenGL.
Title: Re: Static Linking
Post by: eXpl0it3r on January 17, 2014, 08:52:22 am
I'm not sure what you mean. How is that done?
You might want to learn how to link things then. It's a crucial process in programming! ;)

Add opengl32 to the linking settings, but that's not all. If you have built from source, see here (https://github.com/SFML/SFML/wiki/FAQ#wiki-build-link-static).
Title: Re: Static Linking
Post by: Xornand on January 17, 2014, 05:15:05 pm
If you're developing on Windows in Visual Studio, make sure you have the following entries in the Linker -> Input -> Additional Dependencies in the project's properties (besides the standard SFML libraries):
Title: Re: Static Linking
Post by: Xornand on January 18, 2014, 09:34:40 am
I am not sure about Eclipse, however in Visual Studio (using the VC++ compiler) there is no need to recompile anything. It's a simple matter of pointing the linker to the directory of the .lib files that SFML uses (and already provides in its source directories).

As for opengl32.lib and winmm.lib, those files are provided automatically, given that they are specified in the linker's inputs - but again, perhaps Eclipse would require a different approach (especially if you're using a different compiler)?
Title: Re: Static Linking
Post by: eXpl0it3r on January 18, 2014, 10:22:13 am
I can only point you again to the FAQ (https://github.com/SFML/SFML/wiki/FAQ#wiki-build-link-static).

Eclipse uses GCC thus the libraries to link won't have an *.lib extensions, but *.a, however when specifying libraries for GCC, you don't include the extensions, but instead just write: sfml-graphics, winmm, glew, etc
The linker will then automatically search for winmm.a or libwinmm.a etc.

You should really learn how to use your tools (Eclipse, linker, compiler, etc).
Title: Re: Static Linking
Post by: amir ramezani on January 20, 2014, 07:34:32 pm
you must link everything in order your game work fine!