Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. undefined reference to `_imp___ZN7QPixmap9fromImageERK6QImage6QFlagsIN2Qt19ImageConversionFlagEE'
Forum Updated to NodeBB v4.3 + New Features

undefined reference to `_imp___ZN7QPixmap9fromImageERK6QImage6QFlagsIN2Qt19ImageConversionFlagEE'

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 2 Posters 790 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Slawomir_Piernikowski
    wrote on last edited by Slawomir_Piernikowski
    #1

    Hi
    I want to include QImage and QPixmap to class which is a part of library. See pictures hereunder:0_1541352481652_MagazynModelh.png
    I use QPixmap and QImage classes in my cpp file, see hereunder picture:

    0_1541352493550_MagazynModelcpp.png

    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???

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Slawomir_Piernikowski
      wrote on last edited by
      #2

      In DomLibCore.pro file was "Qt -= gui". Should be "Qt += gui".

      See picture hereunder:0_1541364116772_DomLibCore.png

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        As silly as it may sound, are you sure you are linking agains the QtGui module ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Slawomir_Piernikowski
          wrote on last edited by Slawomir_Piernikowski
          #4

          This really has solved the problem. So???.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            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.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            1
            • S Offline
              S Offline
              Slawomir_Piernikowski
              wrote on last edited by
              #6

              No problem

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved