[antlr-interest] Problems with using the C++ grammar provided at antlr.org.

Min Deng min_d99 at yahoo.com
Wed Jul 20 10:01:00 PDT 2005


Hello,

By using the command 
"g++ -c -I../include *.cpp 2>&1 | less", 
I compiled the ANTLR generated Lexer and Parser
sucessfully. But when using the command 
"g++ -o CPPParser *.o -L../lib -lantlr 2>&1 | less",
I got a lot of error messages. I copied some of them
in the following. Could somebody give me a hint what
is wrong? 

BTW:
o   I am using g++ 3.2.0 on cygwin. 
o   I used the precompiled ANTLR C++ library that
exists as lib/libantlr.a.

Thanks
Min

-------------------------------------------------------------
../lib/libantlr.a(MismatchedCharException.o)(.rdata$_ZTVN5antlr23MismatchedCharE
xceptionE+0x0):MismatchedCharException.cpp: multiple
definition of `vtable for a
ntlr::MismatchedCharException'
CPPLexer.o(.data$_ZTVN5antlr23MismatchedCharExceptionE+0x0):CPPLexer.cpp:
first
defined here
../lib/libantlr.a(MismatchedCharException.o)(.rdata$_ZTVN5antlr14ANTLRExceptionE
+0x0):MismatchedCharException.cpp: multiple definition
of `vtable for antlr::ANT
LRException'
CPPLexer.o(.data$_ZTVN5antlr14ANTLRExceptionE+0x0):CPPLexer.cpp:
first defined h
ere
../lib/libantlr.a(MismatchedCharException.o)(.rdata$_ZTIN5antlr23MismatchedCharE
xceptionE+0x0):MismatchedCharException.cpp: multiple
definition of `typeinfo for
 antlr::MismatchedCharException'
CPPLexer.o(.data$_ZTIN5antlr23MismatchedCharExceptionE+0x0):CPPLexer.cpp:
first
defined here
../lib/libantlr.a(MismatchedCharException.o)(.rdata$_ZTVN5antlr11CharScannerE+0x
0):MismatchedCharException.cpp: multiple definition of
`vtable for antlr::CharSc
anner'
CPPLexer.o(.data$_ZTVN5antlr11CharScannerE+0x0):CPPLexer.cpp:
first defined here
../lib/libantlr.a(MismatchedCharException.o)(.rdata$_ZTIN5antlr11CharScannerE+0x
0):MismatchedCharException.cpp: multiple definition of
`typeinfo for antlr::Char
Scanner'
CPPLexer.o(.data$_ZTIN5antlr11CharScannerE+0x0):CPPLexer.cpp:
first defined here
../lib/libantlr.a(MismatchedCharException.o)(.rdata$_ZTIN5antlr14ANTLRExceptionE
+0x0):MismatchedCharException.cpp: multiple definition
of `typeinfo for antlr::A
NTLRException'
CPPLexer.o(.data$_ZTIN5antlr14ANTLRExceptionE+0x0):CPPLexer.cpp:
first defined h
ere
../lib/libantlr.a(MismatchedCharException.o)(.rdata$_ZTVN5antlr11TokenStreamE+0x
0):MismatchedCharException.cpp: multiple definition of
`vtable for antlr::TokenS
tream'
CPPLexer.o(.data$_ZTVN5antlr11TokenStreamE+0x0):CPPLexer.cpp:
first defined here
../lib/libantlr.a(MismatchedCharException.o)(.rdata$_ZTSN5antlr14ANTLRExceptionE
+0x0):MismatchedCharException.cpp: multiple definition
of `typeinfo name for ant
// the remaining output is elided


		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 


More information about the antlr-interest mailing list