SFML community forums

Help => General => Topic started by: Wqer on November 19, 2013, 09:35:35 pm

Title: Linking SFML with Eclipse on Windows
Post by: Wqer on November 19, 2013, 09:35:35 pm
.
Title: Re: Linking SFML with Eclipse on Windows
Post by: G. on November 19, 2013, 09:52:49 pm
You're doing it wrong.

http://gaoth.org/?p=196 or google SFML+Eclipse
Title: Re: Linking SFML with Eclipse on Windows
Post by: eXpl0it3r on November 19, 2013, 10:50:39 pm
Remove the lib prefix. You also might want to read up on how a compiler and linker work, it's crucial for development. ;)
Title: Re: Linking SFML with Eclipse on Windows
Post by: eXpl0it3r on November 20, 2013, 01:56:01 am
Yes, but it seems like your libs are not compatible with your linker. You need to make sure that the libs fully match the use compiler, thus since you use 4.8.1 you can't use any precompiled libs from the download site, but you'll need to compile SFML on your own.

Here (http://en.sfml-dev.org/forums/index.php?topic=7281.msg48091#msg48091)'s a relatively nice description on what a compiler and linker does.
Title: Re: Linking SFML with Eclipse on Windows
Post by: amir ramezani on January 02, 2014, 08:40:21 pm
i didn't saw your pictures correctly
firstly, remove lib prefix
secondly, maybe the libraries are incompatible with your linker
in my idea, recompile them in order to fix this issue
Title: Re: Linking SFML with Eclipse on Windows
Post by: eXpl0it3r on January 03, 2014, 01:00:34 am
Unfortunately images are bound to be deleted with time.
Not if you pay for the hosting - you can even embed the images! ;)

(http://i.imgur.com/9Cl7fmx.png)
Title: Re: Linking SFML with Eclipse on Windows
Post by: amir ramezani on January 03, 2014, 05:09:23 am
I haven't worked with eclipse
but If you are using GCC, make sure the libraries don't have lib prefix and must not have .a suffix
for example, we want to link SFML-system
in your linker settings (project settings->linker in code::blocks), add this:
sfml-system-s
and compile
the linker automaticly find's libsfml-system-s.a
and in my idea, copy and paste the text
because I can't see well
Title: Re: Linking SFML with Eclipse on Windows
Post by: amir ramezani on January 05, 2014, 06:17:14 am
I can't see the images well
but I've sed that
please copy and paste the errors here
Title: Re: Linking SFML with Eclipse on Windows
Post by: Raincode on January 05, 2014, 04:37:21 pm
Try it without the .a suffix
Title: Re: Linking SFML with Eclipse on Windows
Post by: amir ramezani on January 05, 2014, 05:09:20 pm
as I've previously said, you can't plase .a at the end of the libraries while you are linking
Title: AW: Linking SFML with Eclipse on Windows
Post by: eXpl0it3r on January 05, 2014, 08:29:33 pm
Nothing, it's just sfml-graphics, sfml-window, sfml-system, etc
The linker will know what extension to look for. ;)
Title: Re: Linking SFML with Eclipse on Windows
Post by: eXpl0it3r on January 05, 2014, 10:38:01 pm
The linking order is important, it needs to be graphics, window, audio, network, system.
You can remember it, by thinking "graphics depends on window and system" / "audio depends on system" / "network depends on system".
Title: Re: Linking SFML with Eclipse on Windows
Post by: eXpl0it3r on January 05, 2014, 11:45:57 pm
Like this?
Why not just try it, but yes. ;)
Title: AW: Re: Linking SFML with Eclipse on Windows
Post by: eXpl0it3r on January 06, 2014, 12:50:16 am
It didn't work.
Let me get my crystal ball, maybe it will tell me what didn't work................. ::)
Title: AW: Linking SFML with Eclipse on Windows
Post by: eXpl0it3r on January 06, 2014, 07:55:30 am
Try adding opengl32 to the linker list.
Title: Re: AW: Linking SFML with Eclipse on Windows
Post by: Daddi on January 06, 2014, 08:08:17 am
Try adding opengl32 to the linker list.

It looks like the opengl32 lib is missing, but why does he need it? I thought thats only needed if linked statically?
Title: Re: AW: Linking SFML with Eclipse on Windows
Post by: eXpl0it3r on January 06, 2014, 08:29:56 am
It looks like the opengl32 lib is missing, but why does he need it? I thought thats only needed if linked statically?
Not really sure either... :-\
Maybe there's an issue that goes deeper, but for now, that's all I can see/think of. ;)
Title: Re: Linking SFML with Eclipse on Windows
Post by: amir ramezani on January 06, 2014, 09:06:59 am
link with opengl32 and glu32
and define SFML_STATIC while you are compiling with static SFML libraries
in other link options, add -static-libgcc and -static-libstdc++ while you are compiling with static libraries
link with OpenAL32 and sndfile while you are using sfml-audio
Title: Re: Linking SFML with Eclipse on Windows
Post by: eXpl0it3r on January 06, 2014, 10:18:02 am
He's not compiling static... ;)
Title: Re: Linking SFML with Eclipse on Windows
Post by: amir ramezani on January 06, 2014, 01:49:47 pm
He's not compiling static... ;)
so, he doesn't need to define SFML_STATIC and he must not use -static-libgcc and -static-libstdc++ in the linker commands while linking
Title: Re: Linking SFML with Eclipse on Windows
Post by: Nexus on January 06, 2014, 08:38:40 pm
Furthermore, what is this strange beeping noise coming from my computer? It only happens when a SFML program is running and this was the case for other implementations of SFML on this computer as well.
Is there also some weird output on the console? It's probably still a wrong configuration issue. Make sure you don't mix debug/release or anything else that might be incompatible.
Title: Re: Linking SFML with Eclipse on Windows
Post by: amir ramezani on January 07, 2014, 05:16:47 am
yes, when you are compiling for debug build of your application, you have to use the libraries that have -d.a suffix
but, when you are compiling for your release build, you don't need to use the debug libraries