Hi,
try to execute the compiler like "gcc -E -P" and check the output.
Or try to compile the output manually.
ANTLR adds a define for each token you declare and these macro definitions
do interfere with some datatype present in libxml headers.

For example if you create your own token called "int" in .g
then the GLexer.h will contain a macro definition

#define int <some number>

When you declare your own token names, you should always use some prefix.

Ivan
PS: did you try to switch the order of headers included?
PS2: <off-topic> on the other hand it is impossible to compile ANTLR headers
with QT, because QT contains macro called "emit" white emit is a name
of the function in antlr headers.


Quoting Jim Idle <j...@temporal-wave.com>:

> The header files are interfering with each other. You probably need to
> separate your logic from your parser .g file. However, unless you post all
> of your project it is hard to see why. Look at the lines indicated as in
> error and you will probably find some symbol that ANTLR defines that
> libXML is also defining. When you know what it is, you can possibly undef
> it before including the libXML headers. I will also try to make time
> tomorrow to have a look at this.
>
> Jim
>
>> -----Original Message-----
>> From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-
>> boun...@antlr.org] On Behalf Of Richard Walton
>> Sent: Wednesday, July 20, 2011 6:04 PM
>> To: antlr-interest@antlr.org
>> Subject: [antlr-interest] Antlr C target with LibXML
>>
>> Forgive me if this is not the correct etiquette for asking questions -
>> This is the first mailing list I've subscribed to.  I'm having a
>> problem compiling an application using LibXML2 (http://xmlsoft.org/)
>> with a C lexer/grammar generated from ANTLR.  My problems are
>> documented here:
>> http://stackoverflow.com/questions/6769548/antlr-c-target-and-xmllib
>>
>> I would be very grateful for any help in fixing the problem.
>>
>> Kind regards,
>> Richard
>>
>> List: http://www.antlr.org/mailman/listinfo/antlr-interest
>> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
>> email-address
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe:   
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to il-antlr-inter...@googlegroups.com.
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to