[antlr-interest] Re: More VC++ 6 Confusion (MFC libs)
meta.logix at pandora.be
Sun Dec 30 09:05:41 PST 2001
Try using the static antlr library, works for me (use the LIB project
in MSCV6-dll directory).
I have a different problem with using the dll : I cannot get MSVC to
generate an import library (don't have a .def file), and cannot find
any export declarations in the source.
--- In antlr-interest at y..., "kemmerzehl" <malitrait at s...> wrote:
> I do hate to add to your list of confused VC++ user messages but
> I've followed the steps from your existing discussions/literature
> I'm still having some problems. It appears this particular issue
> not yet been addressed although it seems like it would be a
> common problem so I do apologise if I've missed something.
> Anyway, here's the problem. Quite simply, the ANTLR and MFC libs
> just wont work for me together - I get link errors. I've built my
> ANTLR lib files according to JSRS's 'How To', and by themselves
> work well. If I use VC++ to create a 'Win32 Console Application'
> do NOT include MFC support, then add the generated calc example
> and add the ANTLR library, everything compiles links and runs fine.
> If, however, I do the same thing only I DO include MFC support (and
> remembering to take off the /Yu"stdafx.h" flag), I get the
> link errors:
> LIBC.lib(cfout.obj) : error LNK2005: ___dtold already defined in
> LIBC.lib(crt0dat.obj) : error LNK2005: __cinit already defined in
> LIBC.lib(crt0dat.obj) : error LNK2005: _exit already defined in
> LIBC.lib(crt0dat.obj) : error LNK2005: __exit already defined in
> LIBC.lib(crt0dat.obj) : error LNK2005: __cexit already defined in
> One rather odd thing is that I can get the _debug_ build to work
> (for the calc example) if I link statically to MFC and use the /MT
> flag instead of /MTd(default for debug builds). These flags
> the "Multithreaded" and "Debug Multithreaded" runtime libraries,
> available in the "Code Generation" dropdown section of the "C++"
> in Project -> Settings. This however does not fix the problem for
> release build, I even tried using JSRS's debug version of the ANTLR
> library with the release build (using /MT) and I still got link
> errors. Also, I could not get rid of the link errors at all for the
> project im working on (with either build).
> All of this is purely trial and error for me as I've never had to
> deal with third-party libraries before. I hope some of the info
> provided can be of use and that somebody out there has experienced
> this linking problem before and knows how to fix it. Either way,
> going to keep ripping my hair out trying to fix it, if I find a
> solution I'll post it.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest