Solved undefined reference to `_imp___ZN7QPixmap9fromImageERK6QImage6QFlagsIN2Qt19ImageConversionFlagEE'
-
Hi
I want to include QImage and QPixmap to class which is a part of library. See pictures hereunder:
I use QPixmap and QImage classes in my cpp file, see hereunder picture:I am building the solution and receive some errors:
C:\Users\piern\Desktop\Dom -Qt\Home\DomLibCore\magazynmodel.cpp:-1: błąd: undefined reference to `_imp___ZN6QImageC1ERK7QStringPKc'C:\Users\piern\Desktop\Dom -Qt\Home\DomLibCore\magazynmodel.cpp:-1: błąd: undefined reference to
`_imp___ZN7QPixmap9fromImageERK6QImage6QFlagsIN2Qt19ImageConversionFlagEE'C:\Users\piern\Desktop\Dom -Qt\Home\DomLibCore\magazynmodel.cpp:-1: błąd: undefined reference to `_imp___ZN7QPixmapD1Ev'
C:\Users\piern\Desktop\Dom -Qt\Home\DomLibCore\magazynmodel.cpp:-1: błąd: undefined reference to `_imp___ZN6QImageD1Ev'
C:\Users\piern\Desktop\Dom -Qt\Home\DomLibCore\magazynmodel.cpp:-1: błąd: undefined reference to `_imp___ZNK7QPixmapcv8QVariantEv'
C:\Users\piern\Desktop\Dom -Qt\Home\DomLibCore\magazynmodel.cpp:-1: błąd: undefined reference to `_imp___ZN7QPixmapD1Ev'
How to include QPixmap and QImage properly so that there was no any problem during compilation???
-
In DomLibCore.pro file was "Qt -= gui". Should be "Qt += gui".
See picture hereunder:
-
Hi,
As silly as it may sound, are you sure you are linking agains the QtGui module ?
-
This really has solved the problem. So???.
-
I missed that line:
@Slawomir_Piernikowski said in undefined reference to `_imp___ZN7QPixmap9fromImageERK6QImage6QFlagsIN2Qt19ImageConversionFlagEE':In DomLibCore.pro file was "Qt -= gui". Should be "Qt += gui".
Sure it needs to be, otherwise you're telling qmake to not use the QtGui module therefore your usage of classes coming from that module won't be possible.
-
No problem