Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Ubuntu 10.4 - Code::Blocks - SFML ?  (Read 2800 times)

0 Members and 1 Guest are viewing this topic.

DeusIX

  • Newbie
  • *
  • Posts: 2
    • View Profile
Ubuntu 10.4 - Code::Blocks - SFML ?
« 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Ubuntu 10.4 - Code::Blocks - SFML ?
« Reply #1 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).
Laurent Gomila - SFML developer

DeusIX

  • Newbie
  • *
  • Posts: 2
    • View Profile
Ubuntu 10.4 - Code::Blocks - SFML ?
« Reply #2 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Ubuntu 10.4 - Code::Blocks - SFML ?
« Reply #3 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.
Laurent Gomila - SFML developer

Xorlium

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
Ubuntu 10.4 - Code::Blocks - SFML ?
« Reply #4 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/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Ubuntu 10.4 - Code::Blocks - SFML ?
« Reply #5 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?
Laurent Gomila - SFML developer

 

anything