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

Author Topic: [SOLVED] graphics module needs libglew 1.5, i have newer.  (Read 3879 times)

0 Members and 1 Guest are viewing this topic.

vams

  • Newbie
  • *
  • Posts: 8
    • View Profile
[SOLVED] graphics module needs libglew 1.5, i have newer.
« on: May 13, 2013, 01:18:13 am »
When i try to compile this simple code (taken from a tutorial) :
#include <SFML/Graphics.hpp>

int main()
{
    // create the window
    sf::RenderWindow window(sf::VideoMode(800, 600), "My window");

    // run the program as long as the window is open
    while (window.isOpen())
    {
        // check all the window's events that were triggered since the last iteration of the loop
        sf::Event event;
        while (window.pollEvent(event))
        {
            // "close requested" event: we close the window
            if (event.type == sf::Event::Closed)
                window.close();
        }

        // clear the window with black color
        window.clear(sf::Color::Black);

        // draw everything here...
        // window.draw(...);

        // end the current frame
        window.display();
    }

    return 0;
}

I create the .o , called refwindow.o and  I use this command in linking :

g++ refwindow.o -L/usr/lib/x86_64-linux-gnu/ -ljpeg -lGLEW -lsfml-graphics -lsfml-window -lsfml-system -o refwindow.x
 

But i get this :
/usr/bin/ld: warning: libGLEW.so.1.5, needed by /usr/local/lib/libsfml-graphics.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libjpeg.so.62, needed by /usr/local/lib/libsfml-graphics.so, not found (try using -rpath or -rpath-link)

Well, i searched for those libraries in the /usr/lib/x86_64-linux-gnu/ directory and it turns out I have different version for both:
version 1.8 for glew and .8 for jpeg.

I've tried to apt-get install libglew1.5 but it says i've already have a newer version.
What should i do?
May I get to work SFML with these different versions or can I install in some way the needed versions?
Should the latter be the way, is it possible to mantain both versions for a particular library? The reason is that I have to work with CUDA on my pc and It was quite tricky to get the compiler to work. I'd prefer to change the least possible since I'm afraid to break the unknown reason for why the CUDA compiler works at the moment :)


Additional info:
os : ubuntu 13.04
gcc version = 4.7.x (don't remember which x)
sml libraries version = 2.0

The installation of SFML was a little messy: i've tried also to install 1.6 version before succeding. But i'm quite sure all of the 1.6 libraries are gone now, since i can't find them anymore with "locate" command.

I've installed it following these instructions (tutorial SMFL and linux, version2.0) :
"Finally, option 2 is a good compromise for a quick installation if SFML is not available as an official package. Download the SDK from the download page, unpack it and copy the files to your preferred location: either a separate path in your personal folder (like /home/me/sfml), or a standard path (like /usr/local). "
« Last Edit: May 13, 2013, 02:31:37 am by vams »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: graphics module needs libglew 1.5, i have newer.
« Reply #1 on: May 13, 2013, 01:35:44 am »
I've tried to apt-get install libglew1.5 but it says i've already have a newer version.
What should i do?
At best you should rebuild SFML on your own, so all the library versions match.

May I get to work SFML with these different versions or can I install in some way the needed versions?
Should the latter be the way, is it possible to mantain both versions for a particular library?
It should be possible with ubuntu, but I don't really know how to do it, or where to get it from. As I said the best version is to build SFML on your own. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

vams

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: graphics module needs libglew 1.5, i have newer.
« Reply #2 on: May 13, 2013, 01:50:36 am »
Ok, forgive me for the upcoming question but actually I'm quite new with linux systems.
In order to "build" SFML i can simply following this tutorial, right ? http://www.sfml-dev.org/tutorials/2.0/compile-with-cmake.php
Before following that tutorial, do I have to remove, and how, the actual installation of SFML libraries? (May I simply remove all the libsfml-xxx and headers i've manually installed? )


fstream

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: graphics module needs libglew 1.5, i have newer.
« Reply #3 on: May 13, 2013, 02:09:26 am »
May I simply remove all the libsfml-xxx and headers i've manually installed?
If you installed SFML by moving files manually into directories, you can uninstall by simply removing them, yes.

In order to "build" SFML i can simply following this tutorial, right ?
Yep!

After installing the dependencies, it basically boils down to the following commands:

Code: [Select]
$ cd /tmp
$ wget https://github.com/SFML/SFML/archive/2.0.tar.gz
$ tar zxvf SFML-2.0.tar.gz
$ cd SFML-2.0
$ mkdir build
$ cd build
$ cmake ..
$ make
# make install

vams

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: graphics module needs libglew 1.5, i have newer.
« Reply #4 on: May 13, 2013, 02:31:13 am »
Thank you guys!

First time ever i post something for help in linux -> solved in 1 hour -> faith in humanity restored :)


 

anything