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

Author Topic: segfault when trying to open a window  (Read 1973 times)

0 Members and 1 Guest are viewing this topic.

armornick

  • Newbie
  • *
  • Posts: 3
    • View Profile
segfault when trying to open a window
« on: June 23, 2012, 11:30:32 am »
Hey everyone

I'm trying to use SFML for an application but my application segfaults when I try to open a window.

I'm using Code::Blocks and I've set up my project like shown in the tutorial. I'm using SFML 1.6.

These are the relevant parts of my code:
sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");

. . .

bool Running = true;
while (Running)
{
    App.Display();
}

 

I've also tried copying the code from the tutorial and creating an SFML template project, with the same results.

Other information which is probably irrelevant:
  • My graphics card is Intel Graphics with a Core i3. This should support up to OpenGL 2.1
  • The rest of my code is using LuaJIT 2.0

I hope someone can help me, since I really want to do more with SFML.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Re: segfault when trying to open a window
« Reply #1 on: June 23, 2012, 11:35:21 am »
I'm using Code::Blocks and I've set up my project like shown in the tutorial. I'm using SFML 1.6.

I'd advice you to use SFML 2.0rc. ;)

The rest of my code is using LuaJIT 2.0

There's probably your problem. If the example code doesn't run it's certaintly not SFMLs fault.
I'm not familiar with LuaJIT, can you elaborate more on how the C++ code and LuaJIT work together?

Also do the examples that come with SFML work?
« Last Edit: June 23, 2012, 11:37:27 am by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

armornick

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: segfault when trying to open a window
« Reply #2 on: June 23, 2012, 01:28:44 pm »
Alright, I'll try SFML 2 to see if that fixes it.

It shouldn't have anything to do with LuaJIT. I simply used it to make the window size configurable. I removed it during my tests, but SFML still segfaulted.
Like I said, I also tried copying the code from the tutorial and it still didn't work.

Could the problem be that the SFML libraries were compiled with a different version of MinGW?


armornick

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: segfault when trying to open a window
« Reply #3 on: June 23, 2012, 02:18:39 pm »
So, it turns out switching to v2 fixed it. As a technician, though, I wish I was capable of compiling v1 since I'm still wondering whether compiling it with gcc 4.7.0 or switching to a newer version fixed it.

Quick question, though; is SFML2 API-compatible with SFML1? There aren't much tutorials around for v2 and I don't like to dig around the headers.

Anyways, this is as good as solved, so any way to mark my topic as such?
(Seems every forum has their own rules, and I'm new to this one ;) )

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: segfault when trying to open a window
« Reply #4 on: June 23, 2012, 02:32:23 pm »
Quote
Quick question, though; is SFML2 API-compatible with SFML1?
No. That's why it's SFML 2 and not 1.7.

Quote
There aren't much tutorials around for v2 and I don't like to dig around the headers.
I'm writting the tutorials, but the API doc is already up-to-date.

Quote
Anyways, this is as good as solved, so any way to mark my topic as such?
No, it's ok. This forum has no specific rule.
Laurent Gomila - SFML developer

 

anything