From: John Maddock (john_at_[hidden])
Date: 2004-12-20 12:15:32
> Wouldn't it be better to change the class to use the __declspec(export)
> as others do?
> Or would this not solve the problem?
> At least I am unsure what would happen when trying to mix DLL and static
> boost libs that both derive from noncopyable.
I think it would be OK to delare an all-header class as
__declspec(dllimport), but I'm not completely sure (where does the RTTI
information end up if there is no source file? I think this normally gets
placed in the cpp file that has the first non-inline member function, but
I'm not completely sure).
> BTW. this seems to me only a special case to a more general question.
> When using a DLL version of a class that derives from some other class,
> this would force every other lib that uses the same base, also to be
> used in DLL version. Is this correct?
Correct, the problem comes when you're using third party code, which uses
other third party code and so on, just try using std::list<myclass> in an
exported class and you'll see what I mean. See also the discussion of
dependencies at http://www.boost.org/more/separate_compilation.html#dlls
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk