[ros-users] Reserved message names?

Brian Gerkey gerkey at willowgarage.com
Mon Aug 16 21:53:00 UTC 2010


On Fri, Aug 13, 2010 at 11:19 AM, Brian Gerkey <gerkey at willowgarage.com> wrote:
> To test Josh's hypothesis, you can try compiling with '-U Status', to
> undefine any previous definition of that symbol.
>
> E.g., if you're building an executable called 'bookboot', you could
> add this line to your CMakeLists.txt:
>
> rosbuild_add_compile_flags(bookboot -U Status)
>
> If that works (with your message still called 'Status'), then you'd
> want to track down the #define of 'Status'.

As Josh pointed out, the above test won't actually work, because the
command-line -D and -U options are processed before the source files.
Instead, you can try *defining* Status on the command line to
something unusual, then look for a compiler warning about
redefinition.  E.g.:

rosbuild_add_compile_flags(bookboot -DStatus=42)

You should then see a warning from the compiler something like this:

foo.c:1:1: warning: "Status" redefined
<command-line>: warning: this is the location of the previous definition

The file and line information will indicate where to look for the
#define that's causing trouble.

	brian.



More information about the ros-users mailing list