[antlr-interest] Problems with linking using v2.7.7 // Code::Blocks and MinGW32

Ric Klaren ric.klaren at gmail.com
Mon Dec 11 03:36:28 PST 2006


Hi,

On 12/11/06, Joseph Paterson <joseph.paterson at gmail.com> wrote:
> I'm trying to compile and link a very small Lexer - Parser that I've created
> to suit ANTLR v2.7.7.
> The compilation of the generated C++ source files goes fine, but the linking
> doesn't. I've told the linker to use the library antlr.lib located in the
> lib/ sub-directory of my ANTLR install, but I get the following error
> messages:
>
> mingw32-g++.exe -LC:\MinGW\lib  -o bin\Release\LostCities.exe
> obj\Release\src\Game.o
> obj\Release\src\MoveParser\generated\MoveLexer.o
> obj\Release\src\MoveParser\generated\MoveParser.o
> obj\Release\src\main.o obj\Release\src\AgentAI.o   -s
> C:\antlr\277rc1\lib\antlr.lib
> obj\Release\src\MoveParser\generated\MoveLexer.o(.text+0x159):MoveLexer.cpp:
> undefined reference to
> `antlr::NoViableAltForCharException::NoViableAltForCharException(int,
> std::string const&, int, int)'
> ...

Did you build the lib with the same mingw installation (and options)?
If it's a MSVC lib then it will probably never work (due to ABI
incompatibility).

Cheers,

Ric


More information about the antlr-interest mailing list