rqt plugin undefined symbol
Hello ALL
I have this strange problem that I encountered while trying to write new plugin. I followed the rqt plugin tutorial and I am able to build. But when starting rqt I can see plugin in Visualization menu. When I click I get this message
[ERROR] [1427841427.537909362]: Failed to load nodelet [gps_plot/GPSPlot_1] of type [gps_plot/GPSPlot]: Failed to load library /home/rob/projects/Test/devel/lib//libgps_plot.so. Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Could not load library (Poco exception = /home/rob/projects/Test/devel/lib//libgps_plot.so: undefined symbol: _ZTVN8gps_plot9GPSPluginE)
RosPluginlibPluginProvider::load_explicit_type(gps_plot/GPSPlot) failed creating instance
PluginManager._load_plugin() could not load plugin "gps_plot/GPSPlot": RosPluginlibPluginProvider.load() could not load plugin "gps_plot/GPSPlot"
To get started I get one h and one cpp file. For now I commented out all Qt widget_ and ui_ to just build.
Also
ldd /home/rob/projects/Test/devel/lib//libgps_plot.so
does not show any missing libs
From above error I try to grep for strings
~/projects/Test/devel/lib$ strings libgps_plot.so | grep _ZTVN8gps_plot9GPSPluginE
_ZTVN8gps_plot9GPSPluginE
_ZTVN8gps_plot9GPSPluginE
nm -u libgps_plot.so | grep _ZTVN8gps_plot9GPSPluginE
U _ZTVN8gps_plot9GPSPluginE
So it is there
c++filt _ZTVN8gps_plot9GPSPluginE shows
vtable for gps_plot::GPSPlugin
I also made sure that I export class at bottom of cpp file
PLUGINLIB_EXPORT_CLASS(gps_plot::GPSPlugin, rqt_gui_cpp::Plugin)
So I am little puzzled by this. Any one knows or had this? I am thinking something is missing in my CMakeList file.
Also in above error there is double "//"before libgps_plot.so. Not sure how to fix this. I dod go over my plugin.xml and package.xml and CMakeLists.txt file over and over and I do not see anything odd.
load library /home/rob/projects/Test/devel/lib//libgps_plot.so
Here is my CMakeLists.txt
cmake_minimum_required(VERSION 2.8.3)
project(gps_plot)
find_package(catkin REQUIRED COMPONENTS
dynamic_reconfigure
message_generation
roscpp
rqt_gui
rqt_gui_cpp
sensor_msgs
std_msgs
)
find_package(Boost REQUIRED COMPONENTS
program_options
)
find_package(Qt4 REQUIRED COMPONENTS
QtCore
QtGui
)
include(${QT_USE_FILE})
set(gps_plot_SRCS
src/gpsPlugin.cpp
)
set(gps_plot_HDRS
include/gps_plot/gpsPlugin.h
)
catkin_package(
INCLUDE_DIRS ${gps_plot_INCLUDE_DIRECTORIES}
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS dynamic_reconfigure message_generation roscpp rqt_gui rqt_gui_cpp sensor_msgs std_msgs
)
qt4_wrap_ui(
gps_plot_UIS_H
${gps_plot_UIS}
)
include_directories(
${Boost_INCLUDE_DIRS}
)
link_directories(
${Boost_LIBRARY_DIRS}i
)
include_directories(
include
${catkin_INCLUDE_DIRS}
)
add_library(
${PROJECT_NAME}
${gps_plot_SRCS}
)
target_link_libraries(
${PROJECT_NAME}
${catkin_LIBRARIES}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${Boost_LIBRARIES}
)
find_package(class_loader)
class_loader_hide_library_symbols(${PROJECT_NAME})
install(FILES plugin.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
)
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)
And my plugin.xml
<library path="lib/libgps_plot">
<class name="Btest/GPSPlot" type="gps_plot::GPSPlugin" base_class_type="rqt_gui_cpp::Plugin">
<description>
Test GPS plotter using nmea_msgs/Sentence and sensor_msgs/NavSatFix messages
</description>
<qtgui>
<group>
<label>Visualization</label>
<icon type="theme">folder</icon>
<statustip>Plugins related to visualization.</statustip>
</group>
<label>Test GPS plotter</label>
<icon type="theme">applications-internet</icon>
<statustip>Test GPS and status points on an map</statustip>
</qtgui>
</class>
</library>