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). "