|
Boost Users : |
From: Stuart Dootson (stuart.dootson_at_[hidden])
Date: 2008-07-28 05:56:05
On Mon, Jul 28, 2008 at 8:36 AM, Andrej van der Zee <mavdzee_at_[hidden]> wrote:
> Hi,
>
> I am not much of a Windows programmer, so I have a basic question. I want to make a library that (among other stuff) defines an exception like this:
>
> #include <boost/exception/exception.hpp>
>
> namespace speedo {
>
> typedef boost::error_info<struct tag_error, unsigned> error_info;
>
> class __declspec(dllexport) exception : public boost::exception
> {
> };
>
> }
>
> When I try to compile this, I get the following warning:
>
> c:\cygwin\home\andrej\speedo\trunk\util\exception.h(14) : warning C4275: non dll-interface class 'boost::exception' used as base for dll-interface class 'speedo::exception'
> C:\cygwin\home\Andrej\speedo\trunk\boost/exception/exception.hpp(47) : see declaration of 'boost::exception'
> c:\cygwin\home\andrej\speedo\trunk\util\exception.h(13) : see declaration of 'speedo::exception'
>
>
> Is this a problem, and, how do I get rid of this without changing the boost-exception lib itself?
>
> Cheers,
> Andrej
>
Try putting the __decspec modifier on each (public) method of your
exception class rather than on the class itself. IIRC, that stops MSVC
whinging about not having a __declspec on the base class.
HTH
Stuart Dootson
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net