Kemal Tezer Dilsiz
Kemal Tezer Dilsiz

Reputation: 4009

SFML 2.3.2 integration with Qt 5.7 in Linux

I am trying to use SFML 2.3.2 library with Qt Creator to make a small application.

I have added the libraries with the following code in .pro file:

LIBS += -L"$HOME/Libraries/C++/SFML-2.3.2/lib"

CONFIG(release, debug|release): LIBS += -libsfml-audio -libsfml-graphics -libsfml-network -libsfml-window -libsfml-system

CONFIG(debug, debug|release): LIBS += -libsfml-audio-d -libsfml-graphics-d -libsfml-network-d -libsfml-window-d -libsfml-system-d

INCLUDEPATH += "$HOME/Libraries/C++/SFML-2.3.2/include"
DEPENDPATH += "$HOME/Libraries/C++/SFML-2.3.2/include"

as it was explained on SFML website: https://github.com/SFML/SFML/wiki/Tutorial%3A-Compile-and-Link-SFML-with-Qt-Creator

However, when I go into my file of SFML-2.3.2/lib, I do not see any "-d" ending files.

If I comment out that CONFIG(debug, debug|release) line then I get undefined reference errors. If I don't comment out that same line, then I get cannot find -libsfml-audio-d type of errors.

Here are the files in my $HOME/Libraries/C++/SFML-2.3.2/lib directory:

libsfml-audio.so        libsfml-graphics.so.2.3    libsfml-network.so.2.3.2  libsfml-window.so
libsfml-audio.so.2.3    libsfml-graphics.so.2.3.2  libsfml-system.so         libsfml-window.so.2.3
libsfml-audio.so.2.3.2  libsfml-network.so         libsfml-system.so.2.3     libsfml-window.so.2.3.2
libsfml-graphics.so     libsfml-network.so.2.3     libsfml-system.so.2.3.2

Some notes:

I hope I was able to write a "suitable" question. Thank you for the answers!

Upvotes: 0

Views: 571

Answers (1)

Kemal Tezer Dilsiz
Kemal Tezer Dilsiz

Reputation: 4009

This is probably a messy way but with what Kuba Ober suggested, I was able to figure out a solution. Please let me know if you know a better solution or if this solution was actually the correct way.

I changed my .pro file part to:

LIBS += -L"$HOME/Libraries/C++/SFML-2.3.2/lib"

CONFIG(release, debug|release): LIBS += -lsfml-audio -lsfml-graphics -lsfml-network -lsfml-window -lsfml-system
CONFIG(debug, debug|release): LIBS += -lsfml-audio -lsfml-graphics -lsfml-network -lsfml-window -lsfml-system

INCLUDEPATH += "$HOME/Libraries/C++/SFML-2.3.2/include"
DEPENDPATH += "$HOME/Libraries/C++/SFML-2.3.2/include"

And life is gud.

Upvotes: 1

Related Questions