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

Author Topic: Inherited sf::Drawable crashing  (Read 8537 times)

0 Members and 1 Guest are viewing this topic.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Inherited sf::Drawable crashing
« Reply #15 on: January 22, 2013, 09:31:56 pm »
I'll do that now, but it doesn't seem to matter what I do. I've taken working examples from elsewhere and get the same issue.
Hmm we haven't asked yet, what should've actually been in the first post anyways:
What exact SFML version are you using or from where did you get it?
What exact MinGW version are you using?

Because if the GCC version >= 4.7.x and you're using the RC builds, then it won't work and you'll have to recompile SFML or use my nightly builds. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Camble

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Inherited sf::Drawable crashing
« Reply #16 on: January 22, 2013, 09:33:53 pm »
Even the follow example gives me a segfault when creating an sf::RenderWindow

#include <memory>
#include <SFML/Graphics.hpp>

using namespace std;

int main() {
       
    sf::Event event;
        sf::RenderWindow testWindow(sf::VideoMode(800, 600, 32), "Test");

        while(testWindow.isOpen()) {
                sf::Event event;
                while(testWindow.pollEvent(event)) {
                        if(event.type == sf::Event::Closed || event.key.code == sf::Keyboard::Escape)
                                testWindow.close();
                }

                testWindow.clear();

                testWindow.display();
        }

        return 0;
}
 

Camble

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Inherited sf::Drawable crashing
« Reply #17 on: January 22, 2013, 09:35:27 pm »
What exact SFML version are you using or from where did you get it?
What exact MinGW version are you using?

I'm using SFML 2.0 RC, from this website.
Latest version of MinGW.

I should add that I've been trying different versions in an attempt to get it working. That's why I created a new VM so I could have a clean slate to test it.

Last week, I had a RenderWindow with sprites displayed. Not any more.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Inherited sf::Drawable crashing
« Reply #18 on: January 22, 2013, 09:36:48 pm »
I'm using SFML 2.0 RC, from this website.
Latest version of MinGW.
... which are incompatible. ;)

Would this info have been included in the first post, you'd have gotten your answer (rebuild SFML) in the second post. :D

In case you don't find my Nightlies: http://sfml.my-gate.net/nightly/
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Camble

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Inherited sf::Drawable crashing
« Reply #19 on: January 22, 2013, 09:37:52 pm »
... which are incompatible. ;)

*twitch*

That'll be why my code worked fine with the version of MinGW bundled with CodeBlocks. This is the version I used when I first posted though. Since then I've changed and updated so much. I'll revert back to the older version of MinGW and see how I get on.

I think my original issue was my own fault, using low level pointers etc.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Inherited sf::Drawable crashing
« Reply #20 on: January 22, 2013, 09:41:53 pm »
I'll revert back to the older version of MinGW and see how I get on.
There isn't really the need to do so. The problem is not MinGW, it's the old version of SFML, which anyways already misses some bugfixes...

New is always better! :P
Recompile SFML with the latest compiler or use my Nightly Builds and you're fine!
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Camble

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Inherited sf::Drawable crashing
« Reply #21 on: January 22, 2013, 09:42:21 pm »
2.0 RC is incompatible with MinGW 4.7.x onwards? So the 4.7.1 bundled with CodeBlocks will still cause issues.

I'll recompile SFML.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Inherited sf::Drawable crashing
« Reply #22 on: January 22, 2013, 09:44:47 pm »
2.0 RC is incompatible with MinGW 4.7.x onwards? So the 4.7.1 bundled with CodeBlocks will still cause issues.
Yes, unfortunately... ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Camble

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Inherited sf::Drawable crashing
« Reply #23 on: January 22, 2013, 09:46:05 pm »
No wonder the errors were inconsistent.

Thanks for the help :)

Camble

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Inherited sf::Drawable crashing
« Reply #24 on: January 22, 2013, 11:46:10 pm »
Worked a treat ;D (of course it did ::))

Thanks again for everyone's help. No RTFMs here anyway.