[antlr-interest] Linking against the C runtime.
dario.damico at damix.it
dario.damico at damix.it
Sat Sep 22 17:56:21 PDT 2012
Hi everybody, I have a problem linking against the C runtime for ANTLR. I'm using the following software:
Operating system: Mac OS X 10.7.4
ANTLRWorks+ANTLR: Version 1.4.3 - for Windows, Linux and Mac OS X
ANTLR C Runtime : libantlr3c-3.4.tar.gz
I installed the runtime like this:
./configure --enable-64bit
make
sudo make install
I used ANTLRWorks to generate lexer and parser for a grammar; I obtained
2 .c files and 2 .h files. I tried to compile them like this:
gcc -lantlr3c SimpleCalcParser.c SimpleCalcLexer.c
But I got this error:
SimpleCalcParser.c: In function ‘main’:
SimpleCalcParser.c:347: warning: assignment makes pointer from integer without a cast
Undefined symbols for architecture x86_64:
"_antlr3AsciiFileStreamNew", referenced from:
_main in cc4epMVA.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
If I build the library WITHOUT the --enable-64bit flag, the error looks even worse:
SimpleCalcParser.c: In function ‘main’:
SimpleCalcParser.c:347: warning: assignment makes pointer from integer without a cast
ld: warning: ignoring file /usr/local/lib/libantlr3c.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64)
Undefined symbols for architecture x86_64:
"_antlr3ParserNewStream", referenced from:
_SimpleCalcParserNewSSD in ccTJEO4M.o
"_antlr3AsciiFileStreamNew", referenced from:
_main in ccTJEO4M.o
"_antlr3CommonTokenStreamSourceNew", referenced from:
_main in ccTJEO4M.o
"_antlr3LexerNewStream", referenced from:
_SimpleCalcLexerNewSSD in ccC9Aeuk.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
In these emails, http://www.antlr.org/pipermail/antlr-interest/2010-September/039702.html a problem similar to mine was reported, and was completely solved by adding the --enable-64bit flag.
Any idea? Thanks for your help.
Dario
More information about the antlr-interest
mailing list