I use qt official example and get error:
/media/roroco/disk750/Downloads/qtbase/examples/widgets/desktop/systray/main.cpp:50: undefined reference to `qInitResources_systray()'
here is my CMakeLists.txt
SET(CMAKE_PREFIX_PATH /media/roroco/disk750/Downloads/qtbase)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
find_package(Qt5Widgets)
add_executable(systray main.cpp window.cpp)
target_link_libraries(systray Qt5::Widgets)
How to make this example work
according error message undefined reference to `qInitResources_systray()'
, I should use following CMakeLists.txt
cmake_minimum_required(VERSION 3.3)
project(systray)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
SET(CMAKE_PREFIX_PATH /media/roroco/disk750/Downloads/qtbase)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
find_package(Qt5Widgets)
add_executable(systray main.cpp window.cpp systray.qrc)
target_link_libraries(systray Qt5::Widgets)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With