[antlr-interest] Problem with autotools while using antlr3 C runtime

Jim Idle jimi at temporal-wave.com
Tue Oct 11 08:31:22 PDT 2011


It's a bit of an issue mixing autotools, but after you have included the
one header, #undef PACKAGE before including the next. If possible though,
you should try and keep the includes separate.


Jim

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of ??
> Sent: Tuesday, October 11, 2011 1:36 AM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] Problem with autotools while using antlr3 C
> runtime
>
> Hi All,
>
> the antlr3 C runtime is build with autotools.
> the autotools generate a header antlr3config.h, this header has
> defined: #define PACKAGE "libantlr3c"
>
> my project is also build with autotools, there is a header config.h,
> which
> define: #define PACKAGE "polaris"
> when I compile my code, there is an error:
>
> In file included from /opt/antlr3c/include/antlr3defs.h:246,
>                  from /opt/antlr3c/include/antlr3.h:33,
>                  from PolarisAdmin.cc:13:
> /opt/antlr3c/include/antlr3config.h:96:1: error: "PACKAGE" redefined
>
> the error indicate that  "PACKAGE" has redefined.
>
> is it a bug?  (:
> how can I avoid this error?
>
> thank you in advance.
> --
> hellojinjie
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
> email-address


More information about the antlr-interest mailing list