Hi I'm CreateMaker Inc.
We faced error working to make ROS2 Programming.
error LNK2001: "public: virtual struct QMetaObject const * __cdecl...
For use UI (Qt5) at cpp. we need to use command
this.
When we use this we faced error like that.
So we edit Cmakelists.
first.
set(UI_FILES
ui/maingui.ui)
set(${PROJECT_NAME}_HDRS
include/${PROJECT_NAME}/station_gui.h
include/${PROJECT_NAME}/station_wp.h
)
set(${PROJECT_NAME}_RESOURCES
resources/resource.qrc
)
setting locs header files which have qt info.
and locs ui file
and locs resources which .qrc file. (this can be no exist.)
And
second .
setiing moc
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
third wrap
qt5_wrap_cpp(${PROJECT_NAME}_MOCS ${${PROJECT_NAME}_HDRS})
qt5_add_resources(${PROJECT_NAME}_RCC ${${PROJECT_NAME}_RESOURCES})
qt5_wrap_ui(UI_SRCS ${UI_FILES})
last
add_executable(station_main_node
${${PROJECT_NAME}_MOCS}
${${PROJECT_NAME}_RCC}
${UI_SRCS}
)
add locs which related ui info locs.
this way is on condition that you did everything that need to build your code except these.
have a good time !