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

Author Topic: Compiler errors for SFML sample program  (Read 2744 times)

0 Members and 2 Guests are viewing this topic.

atac57

  • Newbie
  • *
  • Posts: 9
    • View Profile
Compiler errors for SFML sample program
« on: May 12, 2013, 06:36:12 am »
I'm completely new to SFML or any kind of graphics library. Using Ubuntu 10.04. I followed the tutorial on sfml-dev.org, downloaded SFML using the first option. I did g++ filename.cpp -c to compile and I got:
Quote
In file included from /usr/include/SFML/Window.hpp:40,
                 from /usr/include/SFML/Graphics.hpp:32,
                 from graph.cpp:1:
/usr/include/SFML/Window/OpenGL.hpp:47:23: error: GL/gl.h: No such file or directory
/usr/include/SFML/Window/OpenGL.hpp:48:24: error: GL/glu.h: No such file or directory
graph.cpp: In function ‘int main()’:
graph.cpp:6: error: ‘CircleShape’ is not a member of ‘sf’
graph.cpp:6: error: expected ‘;’ before ‘shape’
graph.cpp:7: error: ‘shape’ was not declared in this scope
graph.cpp:9: error: ‘class sf::RenderWindow’ has no member named ‘isOpen’
graph.cpp:12: error: ‘class sf::RenderWindow’ has no member named ‘pollEvent’
graph.cpp:14: error: ‘class sf::Event’ has no member named ‘type’
graph.cpp:15: error: ‘class sf::RenderWindow’ has no member named ‘close’
graph.cpp:18: error: ‘class sf::RenderWindow’ has no member named ‘clear’
graph.cpp:19: error: ‘class sf::RenderWindow’ has no member named ‘draw’
graph.cpp:20: error: ‘class sf::RenderWindow’ has no member named ‘display’
I have a feeling it might be a simple thing, but I don't know. I appreciate any help, thank you.

Cornstalks

  • Full Member
  • ***
  • Posts: 180
    • View Profile
    • My Website
Re: Compiler errors for SFML sample program
« Reply #1 on: May 12, 2013, 08:51:58 am »
Try installing the Ubuntu packages necessary for OpenGL development. If you don't have "GL/gl.h" in /usr/include or /usr/local/include, then you need to obtain it.

atac57

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Compiler errors for SFML sample program
« Reply #2 on: May 13, 2013, 04:05:00 am »
Thank you, looks like that got freeglut installed, but I'm still getting those errors, now it just looks like this:

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

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Compiler errors for SFML sample program
« Reply #3 on: May 13, 2013, 08:54:15 am »
How does your code look like? It seems like you are missing #include directives.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Compiler errors for SFML sample program
« Reply #4 on: May 13, 2013, 11:44:29 am »
If you installed SFML from the repositories it's 1.6, not 2.0.
Laurent Gomila - SFML developer

 

anything