Good day. Faced a problem when trying to "open" an image in Qt Creator.

The program code itself:

#include <QtGui/QImage> #include <iostream> #include <string> using namespace std; int main(){ string str = "file1.bmp"; QImage* img = new QImage(str.c_str()); } 

And the compiler curses:

 undefined reference to `_imp___ZN6QImageC1ERK7QStringPKc' 

It would be great if someone explained to me where I nagreshil and what I'm doing wrong;)

    1 answer 1

    Make sure the GUI module is added to the pro file:

     QT += core gui 

    These are the minimum requirements for your program to be assembled.

    • It was so simple that even insulting. Thanks;) - OilMan