I spent at least 5 hours trying to get the sfml library to work with my QT-creator idea. I followed this tutorial https://github.com/LaurentGomila/SFML/wiki/Tutorial%3A-Compile-and-Link-SFML-with-Qt-Creator , but still no luck.
I keep getting the error that class members do not exist after creating simple code. I can create instances of classes, but when trying to use several
member errors
of created objects. I tried looking for library related problems, sfml problems, but I don't think I'm looking for the right problem.
This works and displays a window that will never be closed until you close the program:
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
while (true)
{
sf::Event event;
}
return 0;
}
As soon as I delete one comment, a tooltip appears. I can’t understand what is happening in life.
Thanks in advance.
additional information
Operating Systems:
Ubuntu 12.10 Live (installed on the hard drive)Project file
I'm sure this is wrongTEMPLATE = app
CONFIG -= qt
SOURCES += main.cpp
LIBS += -L"/home/user/Projects/SFML/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/user/Projects/SFML/include"
DEPENDPATH += "/home/user/Projects/SFML/include"
Errors:
I will send compilation outputmain.cpp: In function 'int main()':
main.cpp:6:5: error: 'CircleShape' is not a member of 'sf'
main.cpp:6:21: error: expected ';' before 'shape'
main.cpp:7:5: error: 'shape' was not declared in this scope
main.cpp:12:23: error: 'class sf::RenderWindow' has no member named 'pollEvent'
main.cpp:14:23: error: 'class sf::Event' has no member named 'type'
main.cpp:15:24: error: 'class sf::RenderWindow' has no member named 'close'
main.cpp:18:16: error: 'class sf::RenderWindow' has no member named 'clear'
main.cpp:19:16: error: 'class sf::RenderWindow' has no member named 'draw'
main.cpp:20:16: error: 'class sf::RenderWindow' has no member named 'display'
16:25:10: The process "/usr/bin/make" exited with code 2.
Error while building project sfmlTest (target: Desktop)
When executing build step 'Make'
Completed pathmake: Leaving directory `/home/username/Documents/Projects/c++/Sfml/sfmlTest-build-desktop-Qt_4_8_1_in_PATH__System__Release'
Compiler Used:
I believe that the Gnu compiler, g ++
source
share