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

Author Topic: Compiling Sample on Ubuntu Linux  (Read 1269 times)

0 Members and 1 Guest are viewing this topic.

Skeith

  • Newbie
  • *
  • Posts: 8
    • View Profile
Compiling Sample on Ubuntu Linux
« on: February 06, 2014, 03:32:23 am »
Hello all,

I've downloaded and installed SFML for linux as described here: http://www.sfml-dev.org/tutorials/2.0/start-linux.php however, when I try to compile the sample (before I can link it with libraries), I get all this:

main.cpp: In function ‘int main()’:
main.cpp:6:5: error: ‘CircleShape’ is not a member of ‘sf’
main.cpp:6:21: error: expected ‘;’ before ‘shape’
main.cpp:7:5: error: ‘shape’ was not declared in this scope
main.cpp:9:19: error: ‘class sf::RenderWindow’ has no member named ‘isOpen’
main.cpp:12:23: error: ‘class sf::RenderWindow’ has no member named ‘pollEvent’
main.cpp:14:23: error: ‘class sf::Event’ has no member named ‘type’
main.cpp:15:24: error: ‘class sf::RenderWindow’ has no member named ‘close’
main.cpp:18:16: error: ‘class sf::RenderWindow’ has no member named ‘clear’
main.cpp:19:16: error: ‘class sf::RenderWindow’ has no member named ‘draw’
main.cpp:20:16: error: ‘class sf::RenderWindow’ has no member named ‘display’

I've tried including the path to includes (/usr/include/SFML), making the command: g++ -c main.cpp -I /usr/include/SFML but still nothing. I've also ensured that the permissions are correctly set, nothing.

Any help would be appreciated.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Compiling Sample on Ubuntu Linux
« Reply #1 on: February 06, 2014, 08:08:42 am »
You've downloaded and installed SFML 1.6.
Laurent Gomila - SFML developer

Skeith

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Compiling Sample on Ubuntu Linux
« Reply #2 on: February 06, 2014, 01:20:45 pm »
Then why is the tutorial placed under the 2.0 section? Anyway, in that case, how can I go about getting the latest version?

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Compiling Sample on Ubuntu Linux
« Reply #3 on: February 06, 2014, 01:23:55 pm »
Then why is the tutorial placed under the 2.0 section?
Are the packages not up-to-date for your distribution?

Anyway, in that case, how can I go about getting the latest version?
Have you been on this page?

I'd personally recommend to use the GitHub version. There have been some changes since SFML 2.1 which might be worth checking out.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Skeith

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Compiling Sample on Ubuntu Linux
« Reply #4 on: February 06, 2014, 01:26:41 pm »
I ask why put it in the 2.0 section since following it seemingly gives you version 1.6. Anyway I will try using the page you linked, thanks.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Compiling Sample on Ubuntu Linux
« Reply #5 on: February 06, 2014, 01:30:26 pm »
It's 1.6 for your own Linux distribution right now, but it may be 2.0 for another distribution or in the future. I can't control what's and what's not in the Linux repositories. That's why the tutorial says:

Quote
Option 1 is the preferred one; if the version of SFML that you want to install is available in the official repositories then get it with your package manager.
Laurent Gomila - SFML developer

Skeith

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Compiling Sample on Ubuntu Linux
« Reply #6 on: February 06, 2014, 03:51:51 pm »
Up and running now, thank you for your help. I downloaded the latest from the page you linked, just modified the commands to allow for the non-standard path.

 

anything