-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Tutorial: Link SFML with Qt Creator
Download the latest stable version of SFML from http://www.sfml-dev.org/download.php
Unzip into a folder called SFML and place the folder in a location where you can find it. Such as:
C:/SFML
Create a Qt Project and edit the (project name).pro file to include the following:
LIBS += -LC:/SFML/lib
CONFIG(release, debug|release): LIBS += -lsfml-audio -lsfml-graphics -lsfml-main -lsfml-network -lsfml-window -lsfml-system
CONFIG(debug, debug|release): LIBS += -lsfml-audio-d -lsfml-graphics-d -lsfml-main-d -lsfml-network-d -lsfml-window-d -lsfml-system-d
INCLUDEPATH += C:/SFML/include
DEPENDPATH += C:/SFML/include
The Mac OSX download includes a install.sh script which will copy the required files to their respective locations.
Create the Qt Project and edit the (project name).pro file to include the following:
LIBS += -L"/usr/local/lib"
CONFIG(release, debug|release): LIBS += -lsfml-audio -lsfml-graphics -lsfml-system -lsfml-network -lsfml-window
CONFIG(debug, debug|release): LIBS += -lsfml-audio -lsfml-graphics -lsfml-system -lsfml-network -lsfml-window
INCLUDEPATH += "/usr/local/include"
DEPENDPATH += "/usr/local/include"
Due to differing dependencies I was unable to link the pre-built linux libraries. Refer to Build and Link SFML with Qt Creator for linux.
If you are using a C++11 version of SFML then you need to add the following to your .pro file:
CONFIG += c++11
If you are having problems compiling try, Build->Clean All or Build->Clean Project and then try to build or run again.