Undefined character when building a qt program: qt_version_tag not found

I am learning Qt5.6. I am working on Ubuntu 14.4.

When connecting my program, the following error appears:

undefined reference to `qt_version_tag'

In CMakeLists.txt:

link_libraries(
    Qt5::Widgets
    Qt5::Core
 )

Where is this symbol defined? What is missing in link_libraries?

To build my CMakeLists.txt, I used the following:

https://gitlab.com/Gluttton/SOS/blob/master/25989448/issue/CMakeLists.txt

+3
source share
1 answer

The problem disappeared when I added the following to my CMakeLists.txt:

qt5_use_modules(MyProject Widgets)

I'm not sure what exactly this does (some of the things CMake does are still mysterious to me). I got this idea by reading the following well-written article:

https://www.kdab.com/using-cmake-with-qt-5/

+1
source

Source: https://habr.com/ru/post/1656796/


All Articles