SFML community forums

Help => General => Topic started by: The Illusionist Mirage on September 15, 2013, 03:38:51 pm

Title: Unable to compile SFML program in Ubuntu 12.10
Post by: The Illusionist Mirage on September 15, 2013, 03:38:51 pm
Hello

I can't compile the following code in Code::Blocks in Ubuntu 12.10:
#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;
}
 

When sing Code::Blocks, I've mentioned in the search directories where the includes and libs are under the compiler and debugger settings. I've also done the necessary steps in the project build options too. But still getting an error.

I've compiled SFML sources and have  built the libs from from make files at the path /home/user404/Libraries/SFML_2_1

Also, whenever I build my program in debug version, this error pops up:
libGLEW.so.1.7 needed by /home/user404/Libraries/SFML_2_1/lib/libsfml-graphics.so, not found

And when I try to install libGLEW.so.1.7 as sudo apt-get install libglew1.7-dev, this happens in the terminal:

Reading package lists... Done
uilding state information... Done
E: Unable to locate package libglew1.7-dev
E: Couldn't find any package by regex 'libglew1.7-dev'


Any suggestions where's the problem?

Thanks

EDIT:
Also, when I am trying to generate makefiles using cmake cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug -D BUILD_SHARED_LIBS=FALSE, an error pops up :

CMake Error : The source directory "/home/user404/Downloads/SFML_2_1/BUILD_SHARED_LIBS=TRUE" does not exist.

But the part BUILD_SHARED_LIBS=TRUE has nothing to with the search directory
Title: Re: Unable to compile SFML program in Ubuntu 12.10
Post by: Laurent on September 15, 2013, 04:19:44 pm
Quote
But still getting an error.
Which one?

Quote
Also, when I am trying to generate makefiles using cmake cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug -D BUILD_SHARED_LIBS=FALSE, an error pops up :

CMake Error : The source directory "/home/user404/Downloads/SFML_2_1/BUILD_SHARED_LIBS=TRUE" does not exist.
There's no space between -D and the variable name.
Title: Re: Unable to compile SFML program in Ubuntu 12.10
Post by: The Illusionist Mirage on September 15, 2013, 06:17:38 pm
There's no space between -D and the variable name.

Even after inserting a space it doesn't works.

And the error I am talking about:
libGLEW.so.1.7 needed by /home/user404/Libraries/SFML_2_1/lib/libsfml-graphics.so, not found
Title: Re: Unable to compile SFML program in Ubuntu 12.10
Post by: Laurent on September 15, 2013, 08:33:13 pm
Quote
Even after inserting a space it doesn't works
I meant that you have a space whereas there should be none.

Quote
And the error I am talking about:
libGLEW.so.1.7 needed by /home/user404/Libraries/SFML_2_1/lib/libsfml-graphics.so, not found
Ah. Since you said "also", I thought this was another one ;)
If it's not available in the official repositories, you can download it and compile it.