ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Error in static member function instantiated from ...

asked 2015-03-29 16:41:05 -0600

ROSkinect gravatar image

updated 2015-03-31 02:34:00 -0600

Hi there !

I don't really find a title to my question, but when I try to compile the package I get the folowing errors, I don't know exactly the problem:

image description

Building CXX object columbot/CMakeFiles/MainController.dir/src/MainController.cpp.o
In file included from /opt/ros/hydro/include/ros/service_client.h:33:0,
                 from /opt/ros/hydro/include/ros/node_handle.h:35,
                 from /opt/ros/hydro/include/ros/ros.h:45,
                 from /home/ros/catkin_ws/src/columbot/src/MainController.cpp:8:
/opt/ros/hydro/include/ros/service_traits.h: In static member function ‘static const char* ros::service_traits::MD5Sum<M>::value(const M&) [with M = staubli::command]’:
/opt/ros/hydro/include/ros/service_traits.h:97:104:   instantiated from ‘const char* ros::service_traits::md5sum(const M&) [with M = staubli::command]’
/opt/ros/hydro/include/ros/service_client.h:90:71:   instantiated from ‘bool ros::ServiceClient::call(Service&) [with Service = staubli::command]’
/home/ros/catkin_ws/src/columbot/src/MainController.cpp:21:30:   instantiated from here
/opt/ros/hydro/include/ros/service_traits.h:52:40: error: ‘const struct staubli::command’ has no member named ‘__getServerMD5Sum’
/opt/ros/hydro/include/ros/service_traits.h: In static member function ‘static const char* ros::service_traits::MD5Sum<M>::value() [with M = staubli::command]’:
/opt/ros/hydro/include/ros/service_traits.h:79:103:   instantiated from ‘const char* ros::service_traits::md5sum() [with M = staubli::command]’
/opt/ros/hydro/include/ros/service_client_options.h:94:5:   instantiated from ‘void ros::ServiceClientOptions::init(const string&, bool, const M_string&) [with Service = staubli::command, std::string = std::basic_string<char>, ros::M_string = std::map<std::basic_string<char>, std::basic_string<char> >]’
/opt/ros/hydro/include/ros/node_handle.h:1153:5:   instantiated from ‘ros::ServiceClient ros::NodeHandle::serviceClient(const string&, bool, const M_string&) [with Service = staubli::command, std::string = std::basic_string<char>, ros::M_string = std::map<std::basic_string<char>, std::basic_string<char> >]’
/home/ros/catkin_ws/src/columbot/src/MainController.cpp:176:74:   instantiated from here
/opt/ros/hydro/include/ros/service_traits.h:47:43: error: ‘__s_getServerMD5Sum’ is not a member of ‘staubli::command’
make[2]: *** [columbot/CMakeFiles/MainController.dir/src/MainController.cpp.o] Error 1
make[1]: *** [columbot/CMakeFiles/MainController.dir/all] Error 2
make: *** [all] Error 2
Invoking "make" failed

And these are the concerning files:

Package 1: staubli CMakeLists:

cmake_minimum_required(VERSION 2.8.3) project(staubli)


find_package(catkin REQUIRED COMPONENTS   roscpp   rospy   std_msgs )

include_directories(   ${catkin_INCLUDE_DIRS} )

link_directories(   /home/jros/catkin_ws/devel/lib/   ${catkin_LIBRARY_DIRS} )

add_library(soapC src/soapC.cpp) add_library(Server0 src/soapCS8ServerV0Proxy.cpp) add_library(Server1 src/soapCS8ServerV1Proxy.cpp) add_library(Server3 src/soapCS8ServerV3Proxy.cpp) add_library(stdsoap2 src/stdsoap2.cpp) add_library(tx60l src/TX60L.cpp)

add_executable(staubli_controller src/controller.cpp) target_link_libraries(staubli_controller ${catkin_LIBRARIES})

target_link_libraries(staubli_controller ${catkin_LIBRARIES}  Server0 Server1 Server3 soapC stdsoap2 tx60l)

target_link_libraries(staubli_controller soapC) target_link_libraries(staubli_controller Server0) target_link_libraries(staubli_controller Server1) target_link_libraries(staubli_controller Server3) target_link_libraries(staubli_controller stdsoap2) target_link_libraries(staubli_controller tx60l)

commande.h

Package 2: columbot CMakeLists:

cmake_minimum_required(VERSION 2.8.3) 

project(columbot)

find_package(catkin REQUIRED COMPONENTS   roscpp   rospy   std_msgs staubli) 

include_directories(   ${catkin_INCLUDE_DIRS} ) 

add_executable(MainController src/MainController.cpp)

target_link_libraries(MainController ${catkin_LIBRARIES})

MainController.cpp

I'm using ROS-Hydro in ... (more)

edit retag flag offensive close merge delete

Comments

could you add your CMakeFile please ?

Maya gravatar image Maya  ( 2015-03-29 17:06:09 -0600 )edit

@Maya I just update my question

ROSkinect gravatar image ROSkinect  ( 2015-03-29 17:17:26 -0600 )edit

I think it would be helpful if you didn't use a screenshot to show the error. Just copy/paste the console output, and format it properly using the 101010 button while editing your question.

gvdhoorn gravatar image gvdhoorn  ( 2015-03-31 01:38:00 -0600 )edit

OK @gvdhoorn I did

ROSkinect gravatar image ROSkinect  ( 2015-03-31 02:34:25 -0600 )edit

You can probably coalesce all source files into a single library (with the exception of your main node), and then use a single target_link_libraries(..), instead of the many -- single file -- libraries you have now.

gvdhoorn gravatar image gvdhoorn  ( 2015-03-31 03:01:23 -0600 )edit

2 Answers

Sort by » oldest newest most voted
1

answered 2015-03-31 02:59:48 -0600

gvdhoorn gravatar image

updated 2015-03-31 03:08:35 -0600

The error you are seeing is most likely caused by the fact that the Staubli pkg contains C++ code generated by a really old version of gencpp. The code is in the Staubli/srv/gencpp folder. At least, that is the case on the Subversion server you linked.

In-source builds / code generation were common / accepted practice back then, but with Catkin it is preferable to do an out-of-source build.

I think you should either remove the Staubli/srv/gencpp and build everything using rosmake, or do a proper Catkin migration of the involved packages (see catkin 0.6.11 documentation » How to do common tasks » Package format 1 (legacy) » Building messages, services or actions for the msg/srv generation part).

edit flag offensive delete link more

Comments

oh thank you, you are right. I re-generate the service and it works. But the question is what makes you know that the problem is the old version of gencpp ?

ROSkinect gravatar image ROSkinect  ( 2015-03-31 06:21:49 -0600 )edit

Experience, knowledge of the two build systems and of gencpp.

gvdhoorn gravatar image gvdhoorn  ( 2015-04-01 01:52:48 -0600 )edit
2

answered 2015-03-29 17:22:52 -0600

Maya gravatar image

I might be wrong but if I understand correctly, you're staubli package is a ROS package you created. You need to link it in your columbot (great name btw) CMakeList, because it can't find it.

I would guess something like :

find_package(catkin REQUIRED COMPONENTS   roscpp   rospy   std_msgs     your_staubli_package)

And don't forget to put this after your add_executable(MainController src/MainController.cpp) :

target_link_libraries(MainController ${catkin_LIBRARIES})
edit flag offensive delete link more

Comments

yes this is what I do actually .

Unfourtunatly it doesn't work I get the same error !

ROSkinect gravatar image ROSkinect  ( 2015-03-29 17:32:37 -0600 )edit

Can you find your staubli package. Try rospack find staubli, what's the output ?

Maya gravatar image Maya  ( 2015-03-29 17:38:07 -0600 )edit

Yes the package staubli works fine.

This is what I get:

ros@ros:~$ rospack find staubli
/home/ros/catkin_ws/src/staubli
ROSkinect gravatar image ROSkinect  ( 2015-03-29 17:43:57 -0600 )edit

Okay sorry, end of my knowledge :p. I don't know your code but I think you might have a mistake then more than in the Cmakes. Again, I don't really know sorry :S

Maya gravatar image Maya  ( 2015-03-29 17:54:55 -0600 )edit

Thank you anyways (y)

ROSkinect gravatar image ROSkinect  ( 2015-03-30 04:37:06 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-03-29 16:41:05 -0600

Seen: 986 times

Last updated: Mar 31 '15