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

Author Topic: [SOLVED] Qt Creator QMake Include Libs SFML  (Read 3703 times)

0 Members and 1 Guest are viewing this topic.

Drench

  • Newbie
  • *
  • Posts: 5
    • View Profile
[SOLVED] Qt Creator QMake Include Libs SFML
« on: May 26, 2016, 06:00:09 pm »
Not really sure whether to ask this here or on the qt forums, but here I am so hopefully someone can help (:.

All I'm trying to do is include sfml(2.3.2) into my qt creator project using qmake on linux. In my project directory I have the headers in an 'include' folder and the libraries in a 'lib' folder. I then added two lines to my .pro file:

Code: [Select]
LIBS += -L$$PWD/lib -lsfml-graphics -lsfml-window -lsfml-system
INCLUDEPATH = $$PWD/include

Seems straight forward. But it crashes with SIGABRT  ???

The code I'm running is just a simple test:

#include "SFML/Graphics.hpp"

int main(){
    sf::RenderWindow window(sf::VideoMode(100,100), "window");
    while(window.isOpen()){
        sf::Event event;
        while(window.pollEvent(event)){
            if(event.type==sf::Event::EventType::Closed){
                window.close();
            }
        }
        window.display();
    }
    return 0;
}
 

Thanks for reading  :-*
« Last Edit: May 28, 2016, 03:01:50 pm by Drench »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Qt Creator QMake Include Libs SFML
« Reply #1 on: May 26, 2016, 06:22:55 pm »
Quote
But it crashes
So it's most likely an environment or code issue, nothing to do with the compiler/linker configuration (which is indeed straight-forward).

QtCreator is very bad at telling when a DLL is simply missing. Check this first. Then make sure that your version of SFML matches your compiler (it's easy to get a mismatch with MinGW).
Laurent Gomila - SFML developer

Drench

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Qt Creator QMake Include Libs SFML
« Reply #2 on: May 26, 2016, 07:02:43 pm »
So it's most likely an environment or code issue, nothing to do with the compiler/linker configuration (which is indeed straight-forward).

QtCreator is very bad at telling when a DLL is simply missing. Check this first. Then make sure that your version of SFML matches your compiler (it's easy to get a mismatch with MinGW).
Ok, the libs are definitely there. I have only just downloaded them off the main downloads page: Linux GCC 64 bit. My 'lib' folder has 3 of each .so, .so.2.3, .so.2.3.2 for audio, graphics, network, system, window. I'm using GCC 6.1.1, that should be ok right?

Drench

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Qt Creator QMake Include Libs SFML
« Reply #3 on: May 26, 2016, 08:22:01 pm »
Also, the terminal spits out a bunch of stuff I don't understand other than 'Error':

(click to show/hide)

Drench

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Qt Creator QMake Include Libs SFML
« Reply #4 on: May 26, 2016, 08:26:15 pm »
Actually after a few google searches following that ^ I'm going to try building sfml myself to see if that works.

Drench

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Qt Creator QMake Include Libs SFML
« Reply #5 on: May 27, 2016, 03:05:11 am »
It worked!  :D