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

Author Topic: GL issue, I think [SOLVED]  (Read 5025 times)

0 Members and 1 Guest are viewing this topic.

Andrei15193

  • Guest
GL issue, I think [SOLVED]
« on: July 09, 2012, 10:32:03 am »
Hello,

I've been trying to make a simple sf::Window from the tutorial (both SFML 1.6 and SFML 2.0 give the same error).
Here is the code (exactly the 2.0 test code):
#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(300, 200), "SFML works!");
    sf::Text text("Hello SFML");

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();
        window.draw(text);
        window.display();
    }

    return 0;
}

And here is the output:

$g++ -c test.cpp
In file included from /usr/local/include/SFML/Window.hpp:40:0,
                 from /usr/local/include/SFML/Graphics.hpp:32,
                 from test.cpp:1:
/usr/local/include/SFML/Window/OpenGL.hpp:47:23: fatal error: GL/gl.h: No such file or directory
compilation terminated.

I am using Ubuntu 11.10 32-Bit.

A side question, how do I reinstall SFML and how do I uninstall SFML?
« Last Edit: July 09, 2012, 04:23:23 pm by Andrei15193 »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: GL issue, I think
« Reply #1 on: July 09, 2012, 10:43:27 am »
This error message can only be triggered with SFML 1.6, not SFML 2.

You should remove everything related to SFML 1.6. I can't tell you how if I don't know how you installed it.
Laurent Gomila - SFML developer

Andrei15193

  • Guest
Re: GL issue, I think
« Reply #2 on: July 09, 2012, 10:55:14 am »
I installed SFML 1.6 with sudo make install like the site says and SFML 2.0 was installed with $sudo apt-get install libsfml-dev. I've managed to compile the test program by specifying to the compiler where to find it's libraries and include files.
When I'm trying to run it gives this error:

$./test
./test: error while loading shared libraries: libGLEW.so.1.7: cannot open shared object file: No such file or directory


Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: GL issue, I think
« Reply #3 on: July 09, 2012, 11:09:33 am »
You must install GLEW. If you already have an older version of it, and don't want/can't install 1.7, you can also recompile SFML.

Quote
SFML 2.0 was installed with $sudo apt-get install libsfml-dev
Really? I didn't know they had a pckage for SFML 2.0, since it hasn't even been released. As far as I know, only ArchLinux has one, and it's called SFML-1.99.
Laurent Gomila - SFML developer

Andrei15193

  • Guest
Re: GL issue, I think
« Reply #4 on: July 09, 2012, 11:22:22 am »
Oh I get it, I installed a different version of SFML thinking it's 2.0  :-[ However on the 2.0 tutorial for Linux it says that $sudo apt-get install libsfml-dev is an option.

Anyways, how do I remove any SFML so I can then install SFML 2.0?

SFML 1.6 was installed with $sudo make install
SFML 1.7 (?) was installed with $sudo apt-get install libsfml-dev

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: GL issue, I think
« Reply #5 on: July 09, 2012, 11:27:25 am »
Quote
However on the 2.0 tutorial for Linux it says that $sudo apt-get install libsfml-dev is an option.
Once SFML 2.0 is released, of course.

Quote
Anyways, how do I remove any SFML so I can then install SFML 2.0?
sudo apt-get remove libsfml-dev
And then remove every header/library still on your disk.

Quote
SFML 1.7 (?)
The version is in the description of the package, you know ;)
Laurent Gomila - SFML developer

Andrei15193

  • Guest
Re: GL issue, I think
« Reply #6 on: July 09, 2012, 12:32:50 pm »
Ah cool, thanks for the info ;)

Andrei15193

  • Guest
Re: GL issue, I think
« Reply #7 on: July 09, 2012, 04:23:08 pm »
Ok I've managed to remove all SFML traces and install SFML 2.0 manually. Made GLEW work somehow, it works like a charm so far :). Thanks again for the input ;)