chengyangkj / Ros_Qt5_Gui_App

ROS human computer interface based on Qt5(基于Qt5的ROS人机交互界面)
GNU General Public License v2.0
938 stars 306 forks source link

CCtrlDashBoard导入一直报错 #10

Closed chenguang3312 closed 9 months ago

chenguang3312 commented 3 years ago

CMakeFiles/robot_arm_ui.dir/src/CCtrlDashBoard.cpp.o: In function CCtrlDashBoard::CCtrlDashBoard(QWidget*, CCtrlDashBoard::StyleType)': CCtrlDashBoard.cpp:(.text+0x4e): undefined reference tovtable for CCtrlDashBoard' CCtrlDashBoard.cpp:(.text+0x5c): undefined reference to `vtable for CCtrlDashBoard' collect2: error: ld returned 1 exit status

cpp .h文件导入后会报这样错误,重新编译也解决不了。QT小白 不吝赐教

chengyangkj commented 3 years ago

CMakeFiles/robot_arm_ui.dir/src/CCtrlDashBoard.cpp.o: In function CCtrlDashBoard::CCtrlDashBoard(QWidget*, CCtrlDashBoard::StyleType)': CCtrlDashBoard.cpp:(.text+0x4e): undefined reference tovtable for CCtrlDashBoard' CCtrlDashBoard.cpp:(.text+0x5c): undefined reference to `vtable for CCtrlDashBoard' collect2: error: ld returned 1 exit status

cpp .h文件导入后会报这样错误,重新编译也解决不了。QT小白 不吝赐教

cmakelist添加如下两句: set(CMAKE_INCLUDE_CURRENT_DIR ON)

添加c++11的支持

set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")

可以对比我的cmakelist,里面的每一行都不可缺少

chenguang3312 commented 3 years ago

ok 解决了 感谢 还有个问题就算QT 订阅图像话题,qt处理图像有大约2s的延时,这个有办法改进么?

hui-Scholarliness commented 2 years ago

ok 解决了 感谢 还有个问题就算QT 订阅图像话题,qt处理图像有大约2s的延时,这个有办法改进么?

您好,请问您是怎么解决的呢?我也是遇到你说的这个问题,在cmakelist.txt添加up主说的那两行也没有效果,还是一样的报错