Search code examples
c++qtsfml

Using SFML with Qt creator?


I've recently began learning the SFML API for learning purposes but it seems to me like it only supports Codeblocks IDE and Visual Studio. I dislike both IDEs for my own ideas and I like the IDE that comes with Qt instead.

Is it possible to basically use SFML within the Qt creator?

EDIT:

I know some of you may some day find this on google, after struggling for 8 days to set up sfml to work with qt creator I've found the sollution:

step 1: Download the VS version of SFML from the website (NOT codeblocks version) step 2: copy the DLLs from C:\SFML-1.6\lib to your system32 directory step 3: open qt creator, make a plain C++ project, open your .pro file and add these lines:

    INCLUDEPATH += C:\SFML-1.6\include
LIBS += C:\SFML-1.6\lib\sfml-system.lib \
    C:\SFML-1.6\lib\sfml-window.lib \
    C:\SFML-1.6\lib\sfml-graphics.lib \
    C:\SFML-1.6\lib\sfml-audio.lib \
    C:\SFML-1.6\lib\sfml-network.lib

And you're done!


Solution

  • Short answer: Yes.

    The IDE doesn't really matter all that much. The compiler does. Depending on the compiler used by Qt Creator, you download the appropriate SFML package. Most likely the MinGW based version will work just fine with your default install of Qt Creator. (I believe that relies on MinGW?)

    All that then remains to be done is place SFML in its own directory and making sure that you set up the correct paths in your Qt Creator project. There's not much to it really.