undefined reference to `__imp__ZN11QSerialPortC1EP7QObject' using CMake(mingw)
-
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? -
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?@DiaaQTdev One possibility would be to build Qt 5.12.0 after applying this patch: https://codereview.qt-project.org/c/qt/qtbase/+/282408
-
@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). -
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.
@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!
-
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?
@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...
-
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
@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...