0
$\begingroup$

Rosanswers logo

Hello all !

I have a package with a server that use a custom message for a service. The thing is that I need to compile twice for it to see the message for the server.

Lets say I suppress my build and devel in my catkin. Then I use catkin_make The first time I have this error :

fatal error: open_tld_3d/model.h: No such file or directory

Then catkin_make again and everything is fine this time.

I was wondering what could cause this behavior since everything seem to be ok the second time. I guess it's just that it is not able to see the message created at first and then on the second run it is able to finally find it but I don't know what to change to make it find the message on the firs run.

I don't want to put all my CMakeList.txt here (because they're big) so if you could please tell me what could be relevant to find the reason and I'll put it on this post.

Thanks a lot


Originally posted by Maya on ROS Answers with karma: 1172 on 2014-06-11

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Your executable target needs to depend on the message generation target for your message package.

You can do this in the CMakeLists.txt for your executable with:

add_dependencies(executable open_tld_3d_generate_messages_cpp)

Originally posted by ahendrix with karma: 47576 on 2014-06-11

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by joq on 2014-06-11:
mentioned here in the docs: http://docs.ros.org/api/catkin/html/howto/building_msgs.html .

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.