/MyFolder/main.cpp:9: undefined reference to 'QGraphicsScene::QGraphicsScene(QObject*)' /MyFolder/main.cpp:5: undefined reference to 'QGraphicsScene::~QGraphicsScene()'
IDE: Qt Creator 1.3.1
Project type: Qt4 Console Application
Selected required modules: QtCore
As the link error indicates, QGraphicsScene is included but not added to project. The project file might look like this:
#------------------------------------------------- # # Project created by QtCreator 2010-04-30T13:50:36 # #------------------------------------------------- QT -= gui TARGET = CppQtHelloWorldWindowed CONFIG += console CONFIG -= app_bundle TEMPLATE = app SOURCES += main.cpp
If you want to work with QGraphicsScene you will need to add QtGui to your project in the select required modules dialog in the project creation wizard. One (correct or incorrect?) way to remove it is by changing the project file to:
#------------------------------------------------- # # Project created by QtCreator 2010-04-30T13:50:36 # #------------------------------------------------- TARGET = CppQtHelloWorldWindowed CONFIG += console CONFIG -= app_bundle TEMPLATE = app SOURCES += main.cpp