/home/xxx/ws_qt/src/qtgui/qtgui/include/qtgui/main_window.hpp:17: error: ui_main_window.h: No such file or directory #include "ui_main_window.h" ^~~~~~~~~~~~~~~~~~
/home/xxx/ws_qt/build/qtgui
ui_main_window.h
在 main_window.hpp 的头部添加:
main_window.hpp
#include "/home/xxx/ws_qt/build/qtgui/ui_main_window.h"
直接把绝对路径写上,这样编译就可以通过了,切记不要写相对路径,因为编译会生成其他文件,其他文件可找不到这个相对路径在哪!