# Why is msg header not generated

Hi,

I'm trying to build my package (Gui), which contains a msg-folder, containing rect.msg, containing four Int32 values. In my CMakeLists.txt I added

rosbuild_genmsg()


When running cmake, the folder msg_gen is generated, containing the "generated"-file (containing "yes"). In my cpp-file (which location is {Gui}/foo/bar.cpp) I could use

#include "Gui/rect.h"


and it would build just fine. I committed it to my build server, and there it failed to build, giving the error Gui/rect.h: No such file or directory. . And for some reason, since then, my local rosmake couldn't find the header any more either.

I've searched and found nothing about what is causing this. I tried several things that didn't work, including:

rosbuild_add_generated_msgs(rect.msg)


This would tell the compiler that the messages are generated during the build. I also tried including "ros/ros.h" above including the message-header.

I checked my manifest.xml but that doesn't seem to be relavant for this.

I'm sure it's a rooky mistake, I've been working with ros (and cmake) little over a month, running into several issues that would eventually become clear to me, but this one doesn't.

TIA

Jan Willem

edit retag close merge delete

Does a simple make clean && make fix that? Otherwise try cleaning up the cmake file if you added a lot of test stuff in there - rosbuild_genmsg() should be sufficient.
( 2011-09-01 21:03:23 -0500 )edit

Sort by » oldest newest most voted

Eventually I solved it. It appears that the contents of my message were not valid: I used the type Int32 instead of int32. This became clear to me when I removed all references to the non-existent header, built it and looked very closely at the build output in QtCreator.

Because of the wrong type used, it gave a very non-descriptive error, telling me that Gui/msg/Int32.msg was not found (the message name was Gui/msg/rect.msg).

more