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

Author Topic: SFML2 with mingw  (Read 1370 times)

0 Members and 1 Guest are viewing this topic.

void

  • Newbie
  • *
  • Posts: 5
    • View Profile
SFML2 with mingw
« on: March 15, 2013, 01:13:24 am »
Hi

For a short time I'm far a way from my Linux machine so I decided to use the same code under Windows.
I've installed mingw, everything compiles and links fine.

Then an error comes from code:
 sf::VideoMode vm(600, 500, 32);
That's the beginning of my program (temporary to pinpoint the problem)

Program received signal SIGSEGV, Segmentation fault.
0x691c2811 in sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int) ()

Who there can be a segfault within that function?:
VideoMode::VideoMode(unsigned int modeWidth, unsigned int modeHeight, unsigned int modeBitsPerPixel) :
width       (modeWidth),
height      (modeHeight),
bitsPerPixel(modeBitsPerPixel)
{

}
 

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: SFML2 with mingw
« Reply #1 on: March 15, 2013, 01:21:02 am »
Make sure the binaries are compatible and you're not mixing debug and release modes or static and dynamic builds.

If you're using the latest MinGW version (4.7.x) and the RC from the download page, then things 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/

void

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: SFML2 with mingw
« Reply #2 on: March 16, 2013, 10:13:26 am »
Thanks, I'll try to assemble more compatible development environment.