[antlr-interest] ANTLR status wrt Visual C++ 6.0

Ric Klaren klaren at cs.utwente.nl
Thu Aug 12 02:50:19 PDT 2004


On Wed, Aug 11, 2004 at 10:43:08PM -0000, Michael Searles wrote:
> Can ANTLR be used with Microsoft Visual C++ 6.0? (I'm running on Win
> 2000)
>
> Issues:
>
> I've downloaded from antlr-20040315.tar.gz from

Note that the 2.7.4 release is newer than this snapshot. AFAIK 2.7.4 should
work ok using a static linking and DLL's should be ok with MSVC 7+.

> and after creating a project manually as described in the README file,
> I can build the DLL, but it whines about not supported on old MSVC's.
>
> #if ( _MSC_VER < 1300 )
> # error "DLL Build not supported on old MSVC's"
> // Ok it seems to be possible with STLPort in stead of the vanilla
> MSVC STL
> // implementation. This needs some work though. (and don't try it if
> you're
> // not that familiar with compilers/building C++ DLL's in windows)
> #endif
>
> Does anyone know if it's safe to build the DLL with VC++ 6.0?  If I
> comment out this line, it compiles without errors. Question is, will the
> resulting DLL be OK?

Read the comment I'd say.... Grab MSVC 7+ if you don't want headache.
Alternatively using a static library should work ok (at least some people
said it was ok). In the odd case that microsoft did some serious fixing in
a service pack you might give it a try and report back. You can remove the
#error there and fix up dll.cpp and hope you can build an example with the
result (don't ask me how I'm no expert with microsoft compilers and dll's)

> Next Issue...
>
> When I build calc.g (using antlr.jar from the antlr-20040315 directory
> -- using Java j2sdk1.4.2_04), the C++ code that's generated, when I
> then attempt to compile it with VC++ 6.0, these errors occur...
>
> Compiling...
> CalcTreeWalker.cpp
> CalcTreeWalker.cpp(39) : error C2065: '_retTree' : undeclared
> identifier
> CalcTreeWalker.cpp(87) : error C2679: binary '=' : no operator defined
> which takes a right-hand operand of type 'class antlr::
> ASTRefCount<class antlr::AST>' (or there is no acceptable conversion)
> CalcParser.cpp
> CalcParser.cpp(34) : error C2065: 'returnAST' : undeclared identifier
> (many more follow.)
>
> Are these issues something that I'm doing wrong, or is the
> Windows/Visual C++ 6.0 environment not supported or unstable at this
> time?

Try 2.7.4 first I'd say. Although this particular output does not ring a
bell.. If 2.7.4 gives these errors as well then it would help to see some
generated code. _retTree is an attribute of the treewalker class. By any
chance you got multiple antlr versions installed it looks like it could be
a mixup in support lib and antlr version used to generate the cpp file.

> I'm just getting started on trying to use ANTLR for a project, and if
> this environment is in limbo, I will have to take another approach.
>
> Can anyone offer suggestions?  Is anyone using ANTLR on Windows 2000,
> with VC++ 6.0 without issues?

Check out lib/cpp/README in the distro for the latest notes with microsoft
compilers.

Cheers,

Ric
--
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- j.klaren at utwente.nl ----- +31 53 4893755  ----
-----+++++*****************************************************+++++++++-------
  Wo das Chaos auf die Ordnung trifft, gewinnt meist das Chaos, weil es
  besser organisiert ist. --- Friedrich Nietzsche



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list