Reputation: 4009
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:
lsfml
to libsfml
and that's why it is different from the instructions.sudo apt-get install libsfml-dev
and it works with g++ but I could not connect it to Qt (I am unsure about where the library might be located)I hope I was able to write a "suitable" question. Thank you for the answers!
Upvotes: 0
Views: 571
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