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

Peter Palotas peter.palotas at gmail.com
Mon Jul 24 11:47:50 PDT 2006


Just discovered that compiling version 2.7.5 with the exact same project
settings seems to work just fine by the way. So it seems the problem was
introduced in version 2.7.6?

// Peter

On 7/24/06, Peter Palotas <peter.palotas at gmail.com> wrote:
>
> 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@ Token at 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@ Token at 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@
> MismatchedCharException at 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@
> MismatchedCharException at antlr@@2HB) already defined in
> NoViableAltForCharException.obj; second definition ignored
> CharScanner.obj : warning LNK4006: "private: static int const
> antlr::CharScanner::NO_CHAR" (?NO_CHAR@ CharScanner at 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/7a483f92/attachment-0001.html


More information about the antlr-interest mailing list