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

Why is msg header not generated

asked 2011-09-01 20:27:41 -0600

JWvanSilfhout gravatar image

updated 2012-03-01 20:48:01 -0600

kwc gravatar image


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


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:


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.


Jan Willem

edit retag flag offensive 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.
dornhege gravatar image dornhege  ( 2011-09-01 21:03:23 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2011-09-01 23:25:04 -0600

JWvanSilfhout gravatar image

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).

edit flag offensive delete link more

Question Tools


Asked: 2011-09-01 20:27:41 -0600

Seen: 1,342 times

Last updated: Sep 01 '11