Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2004-03-11 17:47:56


Greg Clayton wrote:
> I am trying to do explicitly instantiate specific shared_ptr class
> for export from a Win32 DLL (currently with MSVC6, and eventually in
> VS2003).

First things first. Why do you need to do that? Have you tried not exporting
it, have you encountered any problems?

[...]

> When I look through the exports, some needed class functions seem to
> be missing from the DLL, and linking fails. Most notable are:
>
> void boost::shared_ptr<SomeClass>::reset(SomeClass*)
>
> This function is declared in the shared_ptr header file as:
> template<class Y> void reset(Y * p);

This is a function template. A template can't be exported, only an
instantiation.

    template void boost::shared_ptr<SomeClass>::reset(SomeClass*);

should instantiate reset with Y=SomeClass.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk