Solved I'm trying to make a GUI for ROS and I get these errros.
-
Please help guys I'm about to finish my master thesis and I stuck here for a long time. I can understand that is something with the boost library. For the reason that I had in my laptop QT 4 because, ROS when create the QT package the CMakeLists were for QT4. I made some changes in CMakeLists and I managed to run cmake without problems. But I change the version of Boost library. First I installed version 1.55 then 1.52 and now I have version 1.69.
The version of QT is Qt Creator 4.9.2
Based on Qt 5.12.4 (GCC 7.4.0, 64 bit)
Consider that is the ROS plugin. I'm a little confused about versions in QT. Anyway, here is the CMakeList############################################################################## # CMake ############################################################################## cmake_minimum_required(VERSION 2.8.0) project(Monster_Truck_UI) set(CMAKE_AUTOUIC ON) ############################################################################## # Catkin ############################################################################## # qt_build provides the qt cmake glue, roscpp the comms for a default talker find_package(catkin REQUIRED COMPONENTS qt_build roscpp) include_directories(${catkin_INCLUDE_DIRS}) # Use this to define what the package will export (e.g. libs, headers). # Since the default here is to produce only a binary, we don't worry about # exporting anything. catkin_package() ############################################################################## # Qt Environment ############################################################################## # this comes from qt_build's qt-ros.cmake which is automatically # included via the dependency call in package.xml ############################################################################## # Sections ############################################################################## set(CMAKE_AUTOMOC ON) find_package(Qt5 COMPONENTS Core Gui Widgets) QT5_ADD_RESOURCES(QT_RESOURCES_CPP ${QT_RESOURCES}) QT5_WRAP_UI(QT_FORMS_HPP ${QT_FORMS})############################################################################## # Sources ############################################################################## include_directories( ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ) set(QT_SOURCES src/main.cpp src/mainwindow.cpp src/mainwindow.h src/mainwindow.ui #ROS SRC src/ROS_src/publishers_subscribers/Publishers.h src/ROS_src/publishers_subscribers/Subscribers.h ) ############################################################################## # Binaries ############################################################################## add_executable(Monster_Truck_UI ${QT_SOURCES} ${QT_RESOURCES_CPP} ${QT_FORMS_HPP} ${QT_MOC_HPP}) target_link_libraries(Monster_Truck_UI ${QT_LIBRARIES} ${catkin_LIBRARIES} Qt5::Core Qt5::Widgets) install(TARGETS Monster_Truck_UI RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
-
Please show your code but I guess you have a
using namespace FOO
somewhere in your header. Remove it. -
@Christian-Ehrlicher said in I'm trying to make a GUI for ROS and I get these errros.:
using namespace FOO
https://github.com/alexspirou/ROS_Ackerman_Monster_Truck_/tree/main/Monster_Truck_UI
Here is the code. Indeed I had a namespace, I remove it errors about boost has gone but now I have this error.
-
Hi,
Your header is wrong. You are missing the forward declaration of the "Ui::MainWindow" class, the ui variable is also wrong as it should be a "Ui::MainWindow".
-
@SGaist said in I'm trying to make a GUI for ROS and I get these errros.:
"Ui::MainWindow
Hello. I don't get what I should change. Can you give me an example? -
@Alex_Spi13 said in I'm trying to make a GUI for ROS and I get these errros.:
Can you give me an example?
@SGaist already told you what to do - you member 'ui' is wrong - it must be Ui::MainWindow.
-
@SGaist said in I'm trying to make a GUI for ROS and I get these errros.:
"Ui::MainWindow"
He told me to delete namespace. I thought that he meant
namespace Ui {
class MainWindow;
}
and I deleted this. I wrote back again and now works. Thank you.