[antlr-interest] Linker error on TOKENSOURCE .. Newbie story continues!

mimarob at algonet.se mimarob at algonet.se
Thu Jun 19 03:06:19 PDT 2008


Hello again!

Thank you all for the advice on the 2.7.7 / 3.0.1 antlr issues.

Now I managed to produce a CParser.c and a CLexer.c.

Being a C-code generation fanatic I think it looks great!

Only problem now, I get a linker error on the macro(?) TOKENSOURCE, 
see below:

Any idea what is going wrong?

I have installed libantlr3c-3.0.1



prompt#  cd examples-v3/C/C
prompt#  ls
C.g       C.vcproj.vspscc  compiler_raden.txt  jimtest.h            
test1.i
C.h       CLexer.java      cpp_symbolpp.h      main.c               
test2.i
C.tokens  CParser.java     files               output
C.vcproj  C__.g            input               parse.exe.stackdump
prompt#  java org.antlr.Tool C.g

prompt#  java org.antlr.Tool C.g
ANTLR Parser Generator  Version 3.0.1 (August 13, 2007)  1989-2007
prompt#  gcc -I. -o parse.exe CLexer.c CParser.c main.c -lantlr3c
main.c: In function `main':
main.c:150: warning: passing arg 2 of 
`antlr3CommonTokenStreamSourceNew' makes pointer from integer without a 
cast
/cygdrive/c/DOCUME~1/qeribra/LOCALS~1/Temp/ccumdZZ3.o:main.c:(.
text+0xcd): undefined reference to `_TOKENSOURCE'
collect2: ld returned 1 exit status
prompt#  






More information about the antlr-interest mailing list