SFML community forums

Help => General => Topic started by: Thenightfoe on January 03, 2014, 12:13:11 am

Title: SFML download help
Post by: Thenightfoe on January 03, 2014, 12:13:11 am
This is my first time on this forum so please forgive me if this is in the wrong section but I can't seem to find a solution anywhere. I want to know how to properly download SFML 2.1 on Ubuntu **Linux**. I've tried following the command prompt option: "sudo apt-get install libsfml-dev" but that only has 1.6 and I want 2.1. So then I tried the next option of downloading the SDK but I don't know were to put it, I don't want to have a "personal path" I want to have it work like all the other library's. Is there a way I can download SFML so that it can be used normally? Also if I need to put the SDK somewhere, were do I put it? Also I can't really move files in certain places it says "access denied". I'm very new to this any help would be awesome.
Title: Re: SFML download help
Post by: Daddi on January 03, 2014, 12:36:01 am
On http://www.sfml-dev.org/download/sfml/2.1/ you download the Linux GCC - 64 bits libs.

Inside you will find an "include" and a "lib" folder. The content of the include folder goes into /usr/local/include/ while the lib folders content goes to /usr/local/lib/. After that, gcc should be able to find the headers and libraries :)
Title: Re: SFML download help
Post by: Thenightfoe on January 03, 2014, 12:40:43 am
Thanks. But there's also a "share" folder, what do I do with that? And also how to I give myself permission to move these folders?
Title: Re: SFML download help
Post by: Daddi on January 03, 2014, 12:43:24 am
The permission can be aquired via "sudo" (sudo cp -r ./lib/* /usr/share/lib/).
I'm not sure about the share folder as you don't need it to use sfml.
Title: Re: SFML download help
Post by: eXpl0it3r on January 03, 2014, 12:47:13 am
I rather suggest to either add Sonkun's package (http://en.sfml-dev.org/forums/index.php?topic=11338.0) to aptitude and update SFML that way or build from source (http://www.sfml-dev.org/tutorials/2.1/compile-with-cmake.php).

Also if you don't know "basic" Linux things, such as permissions, you'll have a really hard time with Linux and it might be good to read a bit on it first. :)
Title: Re: SFML download help
Post by: Thenightfoe on January 03, 2014, 12:50:41 am
When I use this it says that it cannot stat './lib/*': no such file or directory. Yah I'm still new to Linux command line.
Title: Re: SFML download help
Post by: Daddi on January 03, 2014, 12:53:01 am
My "code" was just to show how to use sudo, it wasn't meant for you to use, sorry :)
But like eXpl0it3r said, maybe you should start learning Shell-Basics before you head into compiling / linking.
Title: Re: SFML download help
Post by: Thenightfoe on January 03, 2014, 12:59:26 am
So really I just need to learn how to move files in command line using sudo. Then I can move the files to the proper locations and then I can finally use SFML.
Title: Re: SFML download help
Post by: Daddi on January 03, 2014, 01:02:05 am
A better way would be eXpl0it3rs Link to install it via apt-get. But I think its not uptodate (SFML 2.0 instead of 2.1)
Title: Re: SFML download help
Post by: Thenightfoe on January 03, 2014, 01:13:20 am
One last question: Should I move the contents of the SFML-2.1/lib to /usr/local/lib or just the lib file itself?
Title: Re: SFML download help
Post by: Thenightfoe on January 03, 2014, 01:46:14 am
Ok so I moved the lib contents to /usr/local/lib but when I run a program using sfml it gives me errors that say undefined references to libGLEW.so.1.5 and libjpeg.so.62. Where would I find these?
Title: Re: SFML download help
Post by: Daddi on January 03, 2014, 01:56:59 am
These are packages you have to install before you can use SFML. ie libjpeg via "sudo apt-get install libjpeg62". GLEW might be a bit trickier (http://stackoverflow.com/questions/20256085/how-do-i-install-libglew-1-5-for-sfml-2-0)
Title: Re: SFML download help
Post by: Thenightfoe on January 03, 2014, 02:13:22 am
Ok so I installed libjpeg62 but when I try to install libglew1.5 it tells me that its already the newest version. So I'm confused on what to do.
Title: Re: SFML download help
Post by: eXpl0it3r on January 03, 2014, 02:17:12 am
GLEW 1.5 is already older, but it's the version the SFML builds you downloaded are build with. So you either have to get the old libraries (don't ask me, I've no idea) or (better option) build from source. ;)
Title: Re: SFML download help
Post by: Thenightfoe on January 03, 2014, 02:21:16 am
If I build from source do I have to delete the SFML stuff I already have?
Title: Re: SFML download help
Post by: Thenightfoe on January 03, 2014, 02:52:52 am
YAY it worked thanks everyone ;D