Re: [ros-users] Reserved message names?

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Brian Gerkey
Date:  
To: ros-users
Subject: Re: [ros-users] Reserved message names?
On Fri, Aug 13, 2010 at 11:19 AM, Brian Gerkey <> 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.