Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. I'm trying to make a GUI for ROS and I get these errros.
Qt 6.12 LTS is out! See what's new in the release blog

I'm trying to make a GUI for ROS and I get these errros.

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 2.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alex_Spi13
    wrote on last edited by
    #1

    QT.png

    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})
    
    
    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Please show your code but I guess you have a using namespace FOO somewhere in your header. Remove it.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Alex_Spi13
        wrote on last edited by
        #3

        @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.

        qt2.png

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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".

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          A 1 Reply Last reply
          1
          • SGaistS SGaist

            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".

            A Offline
            A Offline
            Alex_Spi13
            wrote on last edited by
            #5

            @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?

            1 Reply Last reply
            0
            • Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @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.

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              1 Reply Last reply
              0
              • A Offline
                A Offline
                Alex_Spi13
                wrote on last edited by
                #7

                @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.

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt
                • Unsolved