0

I am new with QT, so I am not sure how this works. Im trying to compile some C++ code that includes QT code for graphics. I am using the GNU compiler in Code blocks, but whenever I compile it, It gives this error:

fatal error: QGraphicsRectItem: No such file or directory

So how do I fix this? Is there a different compiler I need?

My include statement is:

#include <QGraphicsRectItem>
scopchanov
  • 7,966
  • 10
  • 40
  • 68
user2093795
  • 19
  • 1
  • 5

1 Answers1

1

It is hard to tell from the info you provided. There are several problems that yield this error, not configured the files correctly, there is no such header file, ..., etc. The error is clear though.

Qt is a big library that is why we need qmake to take care of configuring the files, so theoretically speaking, you can generate Makefile and copy-paste the related data to your code-blocks project. As far as I know, qmake supports Visual Studio and Xcode projects but not sure if there is a tool for code-blocks.

CroCo
  • 5,531
  • 9
  • 56
  • 88