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__ZN11QSerialPortC1EP7QObject' using CMake(mingw)

undefined reference to `__imp__ZN11QSerialPortC1EP7QObject' using CMake(mingw)

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 3 Posters 1.3k Views
  • 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.
  • D Offline
    D Offline
    DiaaQTdev
    wrote on last edited by
    #1

    Hello, i have this error in my QT code. Actually, I have many of these errors, related to QSerialPort. As i searched a lot for the cause of this error, i found that it has something to do with using Cmake in QT version: 5.12.0,
    Here is a link stating that it's actually a bug in QT corrected in versions higher than 5.14.
    https://stackoverflow.com/questions/64084652/undefined-references-in-qt5-14-0-static-using-cmake-mingw-in-windows
    => My question: is there a way to correct this error, without having to update my QT version?

    jsulmJ 1 Reply Last reply
    0
    • D DiaaQTdev

      Hello, i have this error in my QT code. Actually, I have many of these errors, related to QSerialPort. As i searched a lot for the cause of this error, i found that it has something to do with using Cmake in QT version: 5.12.0,
      Here is a link stating that it's actually a bug in QT corrected in versions higher than 5.14.
      https://stackoverflow.com/questions/64084652/undefined-references-in-qt5-14-0-static-using-cmake-mingw-in-windows
      => My question: is there a way to correct this error, without having to update my QT version?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @DiaaQTdev One possibility would be to build Qt 5.12.0 after applying this patch: https://codereview.qt-project.org/c/qt/qtbase/+/282408

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • C Offline
        C Offline
        ChrisW67
        wrote on last edited by
        #3

        The patch implies that using a CMake later than 3.13 would also work.

        1 Reply Last reply
        1
        • D Offline
          D Offline
          DiaaQTdev
          wrote on last edited by
          #4

          Thank you for your replies, @jsulm how to apply the patch please? i have never done that

          @ChrisW67 what are you refering to? version of QT?

          jsulmJ 1 Reply Last reply
          0
          • D DiaaQTdev

            Thank you for your replies, @jsulm how to apply the patch please? i have never done that

            @ChrisW67 what are you refering to? version of QT?

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @DiaaQTdev said in undefined reference to `__imp__ZN11QSerialPortC1EP7QObject' using CMake(mingw):

            version of QT?

            CMake version. You said that you are using CMake, right?
            To apply patches please see documentation for "patch" tool (man patch on Unix/Linux).

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • D Offline
              D Offline
              DiaaQTdev
              wrote on last edited by
              #6

              Yes i am using CMake, but on windows, can you please provide a link where i can read about implementing a patch, i searched but didn't find anything useful for this matter.

              jsulmJ 1 Reply Last reply
              0
              • D DiaaQTdev

                Yes i am using CMake, but on windows, can you please provide a link where i can read about implementing a patch, i searched but didn't find anything useful for this matter.

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @DiaaQTdev Before trying to apply patch and build Qt I would try with a newer CMake version (>3.13) as @ChrisW67 suggested: it is way easier to install CMake than to build Qt!

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  DiaaQTdev
                  wrote on last edited by
                  #8

                  Ok, if i install a newer version of Cmake greater than 3.13, do i have to apply the patch?

                  Another question please, can i apply the patch without having to change Cmake version?

                  jsulmJ 1 Reply Last reply
                  0
                  • D DiaaQTdev

                    Ok, if i install a newer version of Cmake greater than 3.13, do i have to apply the patch?

                    Another question please, can i apply the patch without having to change Cmake version?

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @DiaaQTdev said in undefined reference to `__imp__ZN11QSerialPortC1EP7QObject' using CMake(mingw):

                    do i have to apply the patch?

                    No

                    Of course you can apply the patch without changing the CMake version...

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • D Offline
                      D Offline
                      DiaaQTdev
                      wrote on last edited by
                      #10

                      i am sorry for my too many questions, but can you please provide me with a link to understand how to implement a patch on a CMake? your help is much appreciated

                      jsulmJ 1 Reply Last reply
                      0
                      • D DiaaQTdev

                        i am sorry for my too many questions, but can you please provide me with a link to understand how to implement a patch on a CMake? your help is much appreciated

                        jsulmJ Offline
                        jsulmJ Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        @DiaaQTdev said in undefined reference to `__imp__ZN11QSerialPortC1EP7QObject' using CMake(mingw):

                        to understand how to implement a patch on a CMake?

                        Sorry, but what are you talking about?! Nobody suggested to patch CMake tool itself.
                        What was suggested here was:

                        • Apply the patch on the Qt source code (the patch modifies mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in file)
                        • Use a newer CMake version
                          You only need one of these suggestions.

                        Why don't you simply update your CMake to a newer version? This is (as I already wrote before) way easier than patching and building Qt...

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        1

                        • Login

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