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

Author Topic: [SOLVED]I updated code::blocks to 12.11 and now everything crashes  (Read 2542 times)

0 Members and 1 Guest are viewing this topic.

santiaboy

  • Full Member
  • ***
  • Posts: 118
    • View Profile
EDIT3: I didn't removed it because it may help someone. If anyone can tell me if I have been doing the color thing all wrong, please do.

I had a code::blocks version (10.02 or something like that) and I saw there was a new version, and I thought, hey let's update.

First, I tried compiling my Platform project, and this error happened: "error: cannot call constructor 'sf::Color::Color' directly [-fpermissive]", so I decided to try using sf::Color::Color on a simpler code and the same error happened.

Basically I can't do this:

        window.clear(Color::Color(120,120,120));

but I can do this

       window.clear(Color(120,120,120));

______________________________________

EDIT 2: I read about cMake, and unofficial nightly builds, so if anyone encounters the erroor below, try recompiling SFML and works.

However new projects doesn't work, not even this really simple code.
#include <SFML/Graphics.hpp>

using namespace sf;

int main()
{
    RenderWindow window(VideoMode(800, 600, 32), "SFML basic");
    CircleShape shape(150.f);
    shape.setFillColor(Color::Blue);

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

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

Process terminated with status -1073741819 (0 minutes, 3 seconds)

Is this a code::blocks issue and I should post that there? or is it a SFML one? I've never encountered that error before, and googling provides no useful results
« Last Edit: April 06, 2013, 08:52:32 pm by santiaboy »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10936
    • View Profile
    • development blog
    • Email
Basically I can't do this:

        window.clear(Color::Color(120,120,120));

but I can do this

       window.clear(Color(120,120,120));
The first version is wrong, since the constructor is not a static function, you can't call it like that.
Besides that, I advise you to not use "using namespace sf", it will make your code much more readable and you'll adapt quickly to writing sf::. ;)


EDIT 2: I read about cMake, and unofficial nightly builds, so if anyone encounters the erroor below, try recompiling SFML and works.
Process terminated with status -1073741819 (0 minutes, 3 seconds)
Is this still a problem, or is that resolved? The edits don't make it very clear... ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

santiaboy

  • Full Member
  • ***
  • Posts: 118
    • View Profile
On the first topic, my bad. I have to change all my code now! :(

The error was before, so anyone googling the error, could come across this thread. I'm going to mark it as SOLVED without the guesses to avoid confusion :)

Thanks for the color thingy, I don't know where I got that was the right way.

 

anything