[antlr-interest] DLL under MSVC

Ric Klaren klaren at cs.utwente.nl
Tue Feb 10 01:50:11 PST 2004


On Sun, Feb 08, 2004 at 12:22:11AM +0100, Jrg Werner wrote:
> I'm trying to compile antlr-2.7.3rc2 as a dll using MSVC 7.1. When trying
> to link my project with the dll i get the following error:
> 
> unresolved external symbol '"__declspec(dllimport) public: class
> antlr::ASTRefCount<class antlr::AST> & __thiscall antlr::ASTRefCount<class
> antlr::AST>::operator=(class antlr::AST *)"
> (__imp_??4?$ASTRefCount at VAST@antlr@@@antlr@@QAEAAV01 at PAVAST@1@@Z)',
> verwiesen in Funktion '"public: void __thiscall
> MatlabWalker::patternExecuteStatement(class antlr::ASTRefCount<class
> antlr::AST>)"
> (?patternExecuteStatement at MatlabWalker@@QAEXV?$ASTRefCount at VAST@antlr@@@antlr@@@Z)'

Could it be that it needs a implicit isntantiation ? I was told MSVC7.1
didn't need this but I'm not sure wether that was tested lately. If you
have a look at dll.cpp then you'll notice a whole load of implicit
instantiations of templates for msvc 7.0 try adding the one for ASTRefcount
to a MSVC7.1 specific section and see if that helps.

// these come from AST.hpp
template class ANTLR_API ASTRefCount< AST >;

If you get this to work then I'd appreciate patches so it will work for
antlr 2.7.3.

> Linking with a statically linked antlr-lib works.
> Can anyone help me getting rid of this error?

Of course the antlr lib isn't that big so you could also ask yourself
wether you really need a dll...

It by the way looks like that it's pretty easy to make a dll with MinGW on
win32. I did not get to testing that dll yet but building it was easy. I
hope to get a mingw/cygwin build out of the box for the next prerelease.

Cheers,

Ric
-- 
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- j.klaren at utwente.nl ----- +31 53 4893722  ----
-----+++++*****************************************************+++++++++-------
   Words fly like arrows
      as if we knew what was right and wrong. --- Chuang Tsu



 
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