[antlr-interest] ANTLR274 for C++: Why do I get those warnings on MSVS.NET 7.1

Ric Klaren klaren at cs.utwente.nl
Wed Aug 25 08:56:46 PDT 2004


On Wed, Aug 25, 2004 at 02:41:40PM -0000, Francis ANDRE wrote:
> I am using antlr/cpp generation targeted for MSVS .NET 7.1. Why do I
> get those warnings:
>
> d:\antlr-2.7.4\lib\cpp\antlr\ANTLRException.hpp(53) : warning
> C4251: 'antlr::ANTLRException::text' :
> class 'std::basic_string<_Elem,_Traits,_Ax>' nécessite une interface
> DLL pour être utilisé(e) par les clients de
> class 'antlr::ANTLRException'
>         with
>         [
>             _Elem=char,
>             _Traits=std::char_traits<char>,
>             _Ax=std::allocator<char>
>         ]
> d:\antlr-2.7.4\lib\cpp\antlr\RecognitionException.hpp(66) : warning
> C4251: 'antlr::RecognitionException::fileName' :
> class 'std::basic_string<_Elem,_Traits,_Ax>' nécessite une interface
> DLL pour être utilisé(e) par les clients de
> class 'antlr::RecognitionException'
>         with
>         [
>             _Elem=char,
>             _Traits=std::char_traits<char>,
>             _Ax=std::allocator<char>
>         ]
>
> It seems that the ANTLR_API should also be placed on th definition of
> text and filename but when doing so, there is a compile error!!
>
> Any suggestions???

I'm afraid I'm no MSVC user. So I can't help much with these errors. The
last reports I had were that MSVC7.1 should work out of the box if the DLL
instructions from lib/cpp/README are followed. e.g:

Define ANTLR_EXPORTS when building the ANTLR DLL. Define ANTLR_IMPORTS when
building the program that should use the DLL. Leave them undefined for a
static build.

Try static linking if DLL's give trouble. DLL's and STL seem still good for
headaches on MSVC. Sometimes it also helps to move the whole compiler
together with the ANTLR support lib into one DLL.

A long shot might be to move all the offending class constructors to a .cpp
file. If this is due to inlining it could make sense but I'm mostly
clueless with regard to MSVC.

Cheers,

Ric
--
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- j.klaren at utwente.nl ----- +31 53 4893755  ----
-----+++++*****************************************************+++++++++-------
 Why don't we just invite them to dinner and massacre them all when they're
  drunk? You heard the man. There's seven hundred thousand of them. Ah? ..
           So it'd have to be something simple with pasta, then.
                 From: Interesting Times by Terry Pratchet


 
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