Loading ...
Sorry, an error occurred while loading the content.

4834Re: More VC++ 6 Confusion (MFC libs)

Expand Messages
  • isabellemus
    Jan 4, 2002
    • 0 Attachment

      Concerning stl in dll builds : in MSVC, template classes should
      completely be defined in headers (i.e. everything inline). This is
      what stl does.
      So the actual template expansion will be done when someone (either
      building the dll or trying to use it) includes the dll's headers. So
      I don't think stl is the problem.
      The 2.7.2a1 sources don't compile at all, though. I spent an hour
      trying to figure out what's wrong, and failed. The preprocessor
      output looks OK, the macros look OK, and MSVC complains about every
      single class.


      --- In antlr-interest@y..., Ric Klaren <klaren@c...> wrote:
      > Hi,
      > On Mon, Dec 31, 2001 at 11:52:04PM -0000, jsrs701 wrote:
      > > > I have a different problem with using the dll : I cannot get
      MSVC to
      > > > generate an import library (don't have a .def file), and cannot
      > > > any export declarations in the source.
      > > >
      > > > Isabelle
      > > The import library issue is a messy one. In one of the contrib
      > > for building an ANTLR DLL, it mentions a replacement file
      > > (config.hpp) that contains a macro called DLLEXPORT.
      > > I can't find any trace of this file, nor the macro. Hm.
      > The DLL export stuff is already in antlr-2.7.2a1. It's only called
      > ANTLR_API now (used a different patch than the one in contrib).
      > > You probably don't want to do a .def file, though, since you'll
      > > to deal with the messy C++ munged symbols. Ugh. Better to stick
      > > with the dllimport and dllexport declspecs on the classes
      > >
      > > On second thought, anybody know where that config.hpp file got
      > > to? Ter, Ric? It's the file Michael Richter mentions in his
      > Hmmm strange I cannot recall removing the file. Then again I had
      planned on
      > including the DLL build in 2.7.2. That was before running into a
      whole lot
      > of trouble with MSVC6. It really barfs on a dll build.
      > It refuses to compile/link. My impression (going on the fuzzy error
      > messages it is giving) is that it does not support linking STL
      stuff into
      > DLL's (can this be true?? at least I'm missing the dllexport stuff
      in the
      > stl headers..)??
      > Doing explicit instantiations ala (with some msvc extension):
      > #if defined(_MSC_VER) && !defined(__ICL) // Microsoft Visual C++
      > extern template class ANTLR_API ANTLR_USE_NAMESPACE(std)vector<int>;
      > #endif
      > Seems not to work?
      > I'm not a MSVC expert so I'm hoping some more knowledgeable MSVC6
      > may want to fix the toplevel .dsw .dsp files. It may require adding
      a few
      > directories to the lib/cpp tree for the .dll and the .lib build.
      > Cheers,
      > Ric
      > --
      > -----
      > ---- Ric Klaren ----- klaren@c... ----- +31 53 4893722 ----
      > -----
      > Time what is time - I wish I knew how to tell You why - It hurts
      to know -
      > Aren't we machines - Time what is time - Unlock the door
      > - And see the truth - Then time is time again
      > From: 'Time what is Time' by Blind Guardian
    • Show all 10 messages in this topic