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

Author Topic: Fatal error after linking  (Read 3755 times)

0 Members and 1 Guest are viewing this topic.

lotnik9o

  • Newbie
  • *
  • Posts: 6
    • View Profile
Fatal error after linking
« on: February 28, 2012, 11:53:50 am »
I added the library to my ubuntu and I compiled this code:

Code: [Select]
#include <SFML/System.hpp>
#include <iostream>
 
int main()
{
    sf::Clock Clock;
    while (Clock.GetElapsedTime() < 5.f)
    {
        std::cout << Clock.GetElapsedTime() << std::endl;
        sf::Sleep(0.5f);
    }
 
    return 0;
}


and everything went well :) The next code I will compiling is:
Code: [Select]
#include <SFML/Window.hpp>
 
int main()
{
    sf::Window oknoAplikacji( sf::VideoMode( 400, 400, 32 ), "Wprowadzenie" );
    //sf::Window oknoAplikacji;
        //oknoAplikacji.Create( sf::VideoMode( 400, 400, 32 ), "Wprowadzenie", sf::Style::Fullscreen );
 
        while( oknoAplikacji.IsOpened() )
    {
        oknoAplikacji.Display();
    }
    return 0;
}
 


In my terminal I get:
Code: [Select]
lotnik9o@ubuntu:~/Downloads$ g++ -c 1.cpp
In file included from /usr/local/include/SFML/Window.hpp:40:0,
                 from 1.cpp:1:
/usr/local/include/SFML/Window/OpenGL.hpp:47:23: fatal error: GL/gl.h: No such file or directory
compilation terminated.


How can I solve the problem?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Fatal error after linking
« Reply #1 on: February 28, 2012, 02:15:42 pm »
Install the OpenGL development files ;)
Laurent Gomila - SFML developer

lotnik9o

  • Newbie
  • *
  • Posts: 6
    • View Profile
Fatal error after linking
« Reply #2 on: February 28, 2012, 03:53:38 pm »
Thank you for answer. I solved the problem ( http://ubuntuforums.org/showthread.php?t=1728268 ).

 

anything