Ask Your Question
0

GUI with QT in Catkin [closed]

asked 2016-02-01 10:17:54 -0500

JanOr gravatar image

updated 2016-02-02 02:57:09 -0500

Hello everyone!

I try to create a qt based gui for my package. Therefore I tried to follow the qt tutorials, but get undefined reference errors. I use an eclipse workspace, which shows the qt_gui_cpp:: functions in the auto complete scheme. Therefore I think it is a problem of definition of the plugin. The errors are:

CMakeFiles/Project_node.dir/src/Gui/gui.cpp.o: In function Gui::MyPlugin::initPlugin(qt_gui_cpp::PluginContext&): Catkin/src/Project/src/Gui/gui.cpp:24: undefined reference to qt_gui_cpp::PluginContext::argv() const' Catkin/src/Project/src/Gui/gui.cpp:30: undefined reference to qt_gui_cpp::PluginContext::addWidget(QWidget*)' CMakeFiles/Project_node.dir/src/Gui/gui.cpp.o: In function rqt_gui_cpp::Plugin::Plugin()': /opt/ros/indigo/include/rqt_gui_cpp/plugin.h:57: undefined reference to nodelet::Nodelet::Nodelet()' CMakeFiles/Project_node.dir/src/Gui/gui.cpp.o: In function rqt_gui_cpp::Plugin::~Plugin()': /opt/ros/indigo/include/rqt_gui_cpp/plugin.h:49: undefined reference to nodelet::Nodelet::~Nodelet()' CMakeFiles/Project_node.dir/src/Gui/gui.cpp.o: In functionvoid class_loader::class_loader_private::registerPlugin<gui::myplugin, rqt_gui_cpp::plugin="">(std::string const&, std::string const&)':

In /opt/ros/indigo/include/class_loader/class_loader_core.h I get the undefined reference class_loader::class_loader_private::getCurrentlyLoadingLibraryName()' class_loader::class_loader_private::getCurrentlyActiveClassLoader()' class_loader::class_loader_private::getCurrentlyActiveClassLoader()' class_loader::class_loader_private::hasANonPurePluginLibraryBeenOpened(bool)' class_loader::class_loader_private::getCurrentlyActiveClassLoader()' class_loader::class_loader_private::AbstractMetaObjectBase::addOwningClassLoader(class_loader::ClassLoader*)' class_loader::class_loader_private::getCurrentlyLoadingLibraryName()' class_loader::class_loader_private::AbstractMetaObjectBase::setAssociatedLibraryPath(std::string)' undefined reference to class_loader::class_loader_private::getPluginBaseToFactoryMapMapMutex()' undefined reference toclass_loader::class_loader_private::getPluginBaseToFactoryMapMapMutex()'

CMakeFiles/Project_node.dir/src/Gui/gui.cpp.o: In function std::map<std::string, class_loader::class_loader_private::AbstractMetaObjectBase*, std::less<std::string>, std::allocator<std::pair<std::string const, class_loader::class_loader_private::AbstractMetaObjectBase*> > >& class_loader::class_loader_private::getFactoryMapForBaseClass<rqt_gui_cpp::Plugin>()': /opt/ros/indigo/include/class_loader/class_loader_core.h:124: undefined reference toclass_loader::class_loader_private::getFactoryMapForBaseClass(std::string const&)'

CMakeFiles/Project_node.dir/src/Gui/gui.cpp.o: In function class_loader::class_loader_private::AbstractMetaObject<rqt_gui_cpp::Plugin>::AbstractMetaObject(std::string const&, std::string const&)': /opt/ros/indigo/include/class_loader/meta_object.h:150: undefined reference toclass_loader::class_loader_private::AbstractMetaObjectBase::AbstractMetaObjectBase(std::string const&, std::string const&)' /opt/ros/indigo/include/class_loader/meta_object.h:150: undefined reference to `class_loader::class_loader_private::AbstractMetaObjectBase::~AbstractMetaObjectBase()'

CMakeFiles/Project_node.dir/src/Gui/gui.cpp.o:(.rodata._ZTIN11rqt_gui_cpp6PluginE[_ZTIN11rqt_gui_cpp6PluginE]+0x28): undefined reference to `typeinfo for nodelet::Nodelet'

Unfortunately I cannot resolve the mentioned Functions. Does anyone of you have an idea, how to solve this issue? Thanks a lot in advance!!!

A simplified system setup is given in the following:

My package has the following order:

Catkin/src/Project/
 - src/System/
      -system.cpp     --> Contains int main()
      -system.h 
 - src/Gui/
      -gui.cpp 
      -gui.h 
      -gui.ui
 - CMakeLists.txt
 - package.xml
 - plugin.xml

with CMakeLists:

cmake_minimum_required(VERSION 2.8)
add_definitions(-std=c++11)

project(Project)
find_package(Boost)
find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs message_generation rosbag)
find_package(Qt4 COMPONENTS QtCore QtGui REQUIRED)
include(${QT_USE_FILE})
add_definitions(${QT_DEFINITIONS})

add_message_files(  FILES  messages.msg)        
generate_messages(  DEPENDENCIES  std_msgs) 

catkin_package(
    INCLUDE_DIRS include
    CATKIN_DEPENDS roscpp rospy std_msgs rosbag message_runtime 
    CATKIN_DEPENDS message_runtime
    DEPENDS Boost
)
QT4_WRAP_CPP(MOC_SRC_H  src/Gui/gui.h)
QT4_WRAP_UI(MOC_GUI_H   src/Gui/gui.ui)

include_directories(include 
        ${CMAKE_CURRENT_BINARY_DIR}
        ${Boost_INCLUDE_DIRS} 
        ${catkin_INCLUDE_DIRS ...
(more)
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by JanOr
close date 2016-02-02 06:25:46.069196

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-02-02 02:58:26 -0500

Wolf gravatar image

add rqt_gui_cpp and rqt_gui to the find_package(catkin REQUIRED COMPONENTS ... in CMakeLists.txt

edit flag offensive delete link more

Comments

Oh dear, thanks a lot!

JanOr gravatar imageJanOr ( 2016-02-02 04:33:54 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-02-01 10:17:54 -0500

Seen: 1,194 times

Last updated: Feb 02 '16