79634095

Date: 2025-05-22 15:47:02
Score: 3
Natty:
Report link

I have been struggling with the same linkage issue while trying to use QCustomPlot, and the following setup in my CMakeLists.txt helped resolve it:

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets PrintSupport)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets PrintSupport)

...

target_link_libraries(QCustomPlot_temp PRIVATE
    Qt${QT_VERSION_MAJOR}::Widgets
    Qt${QT_VERSION_MAJOR}::PrintSupport
)

Using Qt${QT_VERSION_MAJOR} ensures compatibility with both Qt5 and Qt6, and properly links the required modules. Hope this helps someone else facing the same issue!

And this links also helps:

https://doc.qt.io/qt-6/qtprintsupport-index.html

Reasons:
  • Blacklisted phrase (1): this link
  • Whitelisted phrase (-1): Hope this helps
  • Contains signature (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Me too answer (2.5): facing the same issue
  • Low reputation (0.5):
Posted by: sam