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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - chakal

Pages: [1]
1
I am trying to install SFML2.0 on Ubuntu 15.10 but I am having issues during the execution of the file.

The code that I want to execute is the following.

#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
    sf::CircleShape shape(100.f);
    shape.setFillColor(sf::Color::Green);

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

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

    return 0;
}

I compile the code with the following command:
g++ -Wall main.cpp -o main.o -L/usr/local/lib -I/usr/local/include
-lsfml-graphics -lsfml-window -lsfml-system

and the compilation works fine! However, when I try to execute ./main.o I am getting

./main.o: error while loading shared libraries: libGLEW.so.1.5: cannot open
shared object file: No such file or directory

I already had an error message related to libGLEW.so.1.5 while compiling of the same code saying

/usr/bin/ld: warning: libGLEW.so.1.5, needed by /usr/local/SFML-2.0/lib/libsfml-graphics.so,
not found (try using -rpath or -rpath-link)

However, the installation with of libGLEW.so.1.5 with apt-get install libglew1.5 solved the issue in the compilation and the the problem right now is in the execution of the file. Do you have any ideas what can I do to solve the problem? Thank you!

2
General / SFML 2.0 Linux installation issue
« on: January 17, 2016, 08:35:40 pm »
Hello,
I am trying without sucess to install SFML 2.0 on a Ubuntu 15.10. Up until now, I worked on SFML in Windows CodeBlocks and I didn't have any serious issues with the installation under Windwos.

However, I am having a lot of trouble when trying to install SFML 2.0 on Ubuntu depsite following the tutorial in the SFML website. I  downloaded the Linux archive from the link http://www.sfml-dev.org/download/sfml/2.0/. After that I extracted the archive to /usr/local/ directory. I try to compile the code main.cpp from the following tutorial: http://www.sfml-dev.org/tutorials/2.0/start-linux.php
When I compile the code with:
g++ main.cpp -o main.o -L/usr/local/include -lsfml-graphics -lsfml-window -lsfml-system
I get:
/usr/bin/ld: cannot find -lsfml-graphics
/usr/bin/ld: cannot find -lsfml-window
/usr/bin/ld: cannot find -lsfml-system

When I compile the code simply with:
g++ main.cpp -o main.o -lsfml-graphics -lsfml-window -lsfml-system
I am getting:
fatal error: SFML/Graphics.hpp: No such file or directory.

Can you tell what should I do to install properly SFML 2.0 on my machine?
Thank you in advance.

3
General / SFML use in Linux and Windows at the same time
« on: December 12, 2015, 02:02:15 pm »
Hello,
I will write a very simple game in C++ and I consider using the SFML library.I will write the game in Windows 7 but I want to be able to compile it and to execute it in Linux as well. How can I do that? If I use the Windows version of SFML does it mean that the code written in Windows will compile also in Linux? If no, then I may use a Linux emulator in Windows. Which emulator would you advice me to use that is compatible with SFML?
Thank you for your reply.

Pages: [1]