[antlr-interest] Error compiling generated C code (possibly 32/64 bit conflict?)

Jim Idle jimi at temporal-wave.com
Tue Jan 20 13:19:05 PST 2009


Andy Grove wrote:
> Hi,
>
> I installed the ANTLR C runtime (version 3.1.1) and compiled it from  
> source successfully on Fedora 10 x86_64 (using the --enable-64bit  
> configuration option).
>
> I also generated C code successfully from my grammar.
>
> However, when I attempt to compile the generated code I get a lot of  
> type conversion errors such as:
>
> MyLexer.c:1634: error: invalid conversion from 'int' to 'const  
> ANTLR3_INT32*'
>
> The code that produces this error is:
>
> /* Transition tables are a table of sub tables, with some tables
>   * reused for efficiency.
>   */
> static const ANTLR3_INT32 * const dfa31_transitions[] =
> {
>      dfa31_T0, dfa31_T139, dfa31_T171, dfa31_T56, dfa31_T131, dfa31_T36,
>      dfa31_T27, dfa31_T147, dfa31_T149, dfa31_T125, dfa31_T170,  
> dfa31_T33,
>
>
> I am using g++ (GCC) 4.3.2 20081105 (Red Hat 4.3.2-7).
>   
Are you trying to compile it as C++ code? Did you use: 
-I/usr/local/wherantlris and of course run 'make install' Looks like 
perhaps it hasn't picked up the header files. make sure you read the 
example in the docs.

Jim


More information about the antlr-interest mailing list