SFML build error in Code::Blocks

Asked

Viewed 204 times

1

I need to make a game for a college subject using the SFML library and the C++ language. I followed this tutorial to configure the Code::Blocks, and pasted the following test file indicated in the tutorial:

#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;
}

However, when compiling, the following message is in the build log:

-------------- Build: Debug in sfml-15-05 (compiler: GNU GCC Compiler)---------------

Linking stage skipped (build target has no object files to link)
Nothing to be done (all items are up-to-date).

And when I click on run, a text box appears saying It seems that this project has not been built yet. Do you want to build it now?. By clicking Yes, the window opens again. By clicking No, a console screen appears saying Process returned 4256912 (0x40F490) executin time : -0.000 s Press any key to continue.

What is expected in the tutorial is a window with a green circle.

I’ve researched these mistakes but I couldn’t solve them.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.