Well, its first time i am using QT. Am i missing some frameworks or something? I am using this tutorial https://youtu.be/8ntEQpg7gck?list=PLMgDVIa0Pg8WrI9WmZR09xAbfXyfkqKWy (or its just outdated, i don't know)
code:
#include <QApplication>
#include <QGraphicsScene>
#include <QGraphicsRectItem>
#include <QGraphicsView>
int main(int argc, char *argv[])
{
QApplication a(int argc, argv);
//Creating a scene
QGraphicsScene * scene = New QGraphicsScene();
//Create an item
QGraphicsRectItem * rect = New QGraphicsRectItem();
rect->setRect(0,0,100,100);
//Adding item into scene
scene->addItem(rect);
return a.exec();
}
errors:
C:\Users\Krzysztof\Documents\QT\Gra\Gra\main.cpp:9: error: C2061: syntax error: identifier 'argv' C:\Users\Krzysztof\Documents\QT\Gra\Gra\main.cpp:12: error: C2065: 'New': undeclared identifier C:\Users\Krzysztof\Documents\QT\Gra\Gra\main.cpp:12: error: C2146: syntax error: missing ';' before identifier 'QGraphicsScene' C:\Users\Krzysztof\Documents\QT\Gra\Gra\main.cpp:15: error: C2065: 'New': undeclared identifier C:\Users\Krzysztof\Documents\QT\Gra\Gra\main.cpp:15: error: C2146: syntax error: missing ';' before identifier 'QGraphicsRectItem' C:\Users\Krzysztof\Documents\QT\Gra\Gra\main.cpp:21: error: C2228: left of '.exec' must have class/struct/union