[antlr-interest] Getting linker errors while building the ANTLR generated sources.

Arik Ter-Galstyan arik_tg at yahoo.com
Wed Sep 24 02:48:14 PDT 2008



Thank you all for support. The problem is solved. Instead of using the native antlr.lib I just compiled the ANTLR sources (native sources not the generated ones) and made a new antlr.lib file using VC++ 2008. Then I used the obtained antlr.lib file to link with my project. This time linker did not report any errors.




--- On Tue, 9/23/08, Jim Idle <jimi at temporal-wave.com> wrote:

> From: Jim Idle <jimi at temporal-wave.com>
> Subject: Re: [antlr-interest] Getting linker errors while building the ANTLR generated sources.
> To: arik_tg at yahoo.com
> Cc: antlr-interest at antlr.org, grey_earl at web.de
> Date: Tuesday, September 23, 2008, 8:04 AM
> On Mon, 2008-09-22 at 22:48 -0700, Arik Ter-Galstyan wrote:
> 
> > Markus and Jim thanks a lot for response. 
> > 
> > Jim,
> > 
> > it's not me trying to link the LIBCMT.lib with
> antlr.lib but the VS2008 on it's own tries to link them
> together.
> 
> The project you are using to compile and link the generated
> code is
> doing it. So, right click on your project and select
> properties, C/C++,
> code generation, Runtime Library, "Multi-threaded
> {Debug} DLL (/MDd).
> Use teh Debug version fo rhte Debug target of your [rpject
> and the
> Release version for the Release target of your project.
> 
> 
> 
> 
> >  I think that the ANTLR generated source files contain
> some function which refer to both libs. 
> 
> 
> That's not how it works.
> 
> > When I'm trying to exclude one of the conflicting
> libs from linking process then I get an "Unresolved
> external symbol" type of link error. 
> 
> 
> 
> > Also, please tell me how can I change the project to
> use MSVCRT ?  
> 
> You need to read the documentation for VS2008 projects.
> 
> Jim


      


More information about the antlr-interest mailing list