SFML community forums

Help => General => Topic started by: DeusIX on September 17, 2010, 06:47:35 pm

Title: Ubuntu 10.4 - Code::Blocks - SFML ?
Post by: DeusIX on September 17, 2010, 06:47:35 pm
How to get this setup work?
The website's tutorial only shows windows version of C::B.


I'm thinking of migrating from SDL to SFML.

I tried to install 1.6, but it failed. Then I installed 1.5 from Ubuntu's repos, but now i'm lost.
Title: Ubuntu 10.4 - Code::Blocks - SFML ?
Post by: Laurent on September 17, 2010, 06:52:53 pm
If you installed SFML from the repositories, you probably won't have to setup your IDE since SFML has been installed in a standard path. Just link to the SFML modules that you use (add sfml-xxx in your linker options, under "additional libraries" or similar).
Title: Ubuntu 10.4 - Code::Blocks - SFML ?
Post by: DeusIX on September 17, 2010, 07:57:40 pm
OK. The clock demo runs. A console with some numbers. Looks fine.

If there are newbies who want this seup, to achieve this:

in Ubuntu package manager search "sfml" install all. (I didn't install debug-symbols though.)

Open C::B

In, Project Build Options > Linker Settings > Link Libraries >Add (sfml-system)

and in,  Project Build Options > Compiler Settings > #Defines > Add (SFML_DYNAMIC)


Now I need to test some gfx.

Tutorial - Window - Handling events
Copying the .cpp into the previous project seems to work, when I add "sfml-window" and "sfml-graphigs".
However i'm running compiz and all i get is a window with garbage.
Title: Ubuntu 10.4 - Code::Blocks - SFML ?
Post by: Laurent on September 17, 2010, 09:06:47 pm
Quote
and in, Project Build Options > Compiler Settings > #Defines > Add (SFML_DYNAMIC)

You may not need this on Linux.

Quote
However i'm running compiz and all i get is a window with garbage.

This happens sometimes, SFML and Compiz don't mix very well because they both use OpenGL. Disabling visual effects should make your SFML apps run fine.
Title: Ubuntu 10.4 - Code::Blocks - SFML ?
Post by: Xorlium on September 18, 2010, 12:42:26 am
I just though I should mention that I couldn't make the sfml 1.5 from the repo's work with my ubuntu 10.04 x86_64. Maybe it was just me, but self-compiled sfml (and now it's easy because of cmake) works nicely. Just make sure you put the libraries on /usr/lib/
Title: Ubuntu 10.4 - Code::Blocks - SFML ?
Post by: Laurent on September 18, 2010, 08:13:01 am
Quote
I just though I should mention that I couldn't make the sfml 1.5 from the repo's work with my ubuntu 10.04 x86_64

What errors did you get?