[antlr-interest] Problem compiling in Visual C++ 7.1

Peter Palotas peter.palotas at gmail.com
Mon Jul 24 11:33:38 PDT 2006


Hi,

I've been trying to compile antlr-2.7.6 in Visual C++ 7.1 (Part of Visual
Studio .NET 2003), but the librarian creates a bunch of warnings about
things being defined twice in the object files which are then replicated
when trying to link to the generated library (see bottom of mail).

Any ideas on what to do to correct this? I simply made a new project,
included all .cpp files from the lib\cpp\src\ directory, compiled as static
library, single-threaded debug, and this is the result.

The command-line options generated for compiling is: /Od /I "..\..\antlr-
2.7.6\lib\cpp" /D "_DEBUG" /D "_LIB" /D "_MBCS" /FD /EHsc /RTC1 /MLd
/Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /nologo /c /Wp64 /ZI /TP

And for the librarian the not so interesting: /OUT:"..\..\lib/libantlrd.lib"
/NOLOGO

Any help on this would be greatly appreciated.

Sincerely, Peter


The warnings from the librarian are:

Creating library...
Token.obj : warning LNK4006: "public: static int const antlr::Token::SKIP"
(?SKIP at Token@antlr@@2HB) already defined in TreeParser.obj; second
definition ignored
Token.obj : warning LNK4006: "public: static int const
antlr::Token::EOF_TYPE" (?EOF_TYPE at Token@antlr@@2HB) already defined in
TreeParser.obj; second definition ignored
Token.obj : warning LNK4006: "public: static int const
antlr::Token::INVALID_TYPE" (?INVALID_TYPE at Token@antlr@@2HB) already defined
in TreeParser.obj; second definition ignored
Token.obj : warning LNK4006: "public: static int const
antlr::Token::NULL_TREE_LOOKAHEAD" (?NULL_TREE_LOOKAHEAD at Token@antlr@@2HB)
already defined in TreeParser.obj; second definition ignored
Token.obj : warning LNK4006: "public: static int const
antlr::Token::MIN_USER_TYPE" (?MIN_USER_TYPE at Token@antlr@@2HB) already
defined in TreeParser.obj; second definition ignored
MismatchedTokenException.obj : warning LNK4006: "public: static int const
antlr::MismatchedTokenException::NOT_SET" (?NOT_SET@
MismatchedTokenException at antlr@@2HB) already defined in TreeParser.obj;
second definition ignored
MismatchedTokenException.obj : warning LNK4006: "public: static int const
antlr::MismatchedTokenException::SET"
(?SET at MismatchedTokenException@antlr@@2HB)
already defined in TreeParser.obj; second definition ignored
MismatchedTokenException.obj : warning LNK4006: "public: static int const
antlr::MismatchedTokenException::NOT_RANGE" (?NOT_RANGE@
MismatchedTokenException at antlr@@2HB) already defined in TreeParser.obj;
second definition ignored
MismatchedTokenException.obj : warning LNK4006: "public: static int const
antlr::MismatchedTokenException::RANGE" (?RANGE@
MismatchedTokenException at antlr@@2HB) already defined in TreeParser.obj;
second definition ignored
MismatchedTokenException.obj : warning LNK4006: "public: static int const
antlr::MismatchedTokenException::NOT_TOKEN" (?NOT_TOKEN@
MismatchedTokenException at antlr@@2HB) already defined in TreeParser.obj;
second definition ignored
MismatchedTokenException.obj : warning LNK4006: "public: static int const
antlr::MismatchedTokenException::TOKEN" (?TOKEN@
MismatchedTokenException at antlr@@2HB) already defined in TreeParser.obj;
second definition ignored
MismatchedCharException.obj : warning LNK4006: "public: static int const
antlr::MismatchedCharException::NOT_SET" (?NOT_SET@
MismatchedCharException at antlr@@2HB) already defined in
NoViableAltForCharException.obj; second definition ignored
MismatchedCharException.obj : warning LNK4006: "public: static int const
antlr::MismatchedCharException::SET" (?SET at MismatchedCharException@antlr@@2HB)
already defined in NoViableAltForCharException.obj; second definition
ignored
MismatchedCharException.obj : warning LNK4006: "public: static int const
antlr::MismatchedCharException::NOT_RANGE" (?NOT_RANGE@
MismatchedCharException at antlr@@2HB) already defined in
NoViableAltForCharException.obj; second definition ignored
MismatchedCharException.obj : warning LNK4006: "public: static int const
antlr::MismatchedCharException::RANGE"
(?RANGE at MismatchedCharException@antlr@@2HB)
already defined in NoViableAltForCharException.obj; second definition
ignored
MismatchedCharException.obj : warning LNK4006: "public: static int const
antlr::MismatchedCharException::NOT_CHAR" (?NOT_CHAR@
MismatchedCharException at antlr@@2HB) already defined in
NoViableAltForCharException.obj; second definition ignored
MismatchedCharException.obj : warning LNK4006: "public: static int const
antlr::MismatchedCharException::CHAR"
(?CHAR at MismatchedCharException@antlr@@2HB)
already defined in NoViableAltForCharException.obj; second definition
ignored
CharScanner.obj : warning LNK4006: "private: static int const
antlr::CharScanner::NO_CHAR" (?NO_CHAR at CharScanner@antlr@@0HB) already
defined in NoViableAltForCharException.obj; second definition ignored
CharScanner.obj : warning LNK4006: "public: static int const
antlr::CharScanner::EOF_CHAR" (?EOF_CHAR at CharScanner@antlr@@2HB) already
defined in NoViableAltForCharException.obj; second definition ignored
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060724/d721b8b8/attachment.html


More information about the antlr-interest mailing list