Re: [Boost-users] dll-interface problems
#include
namespace speedo {
typedef boost::error_info
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
Yes okay, but how do you then export these methods from the base class if they appear in an external library (boost::exception in this case), without changing the external library?
Cheers,
Andrej
----- Original Message ----
From: gast128
'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?
The exported attribute indicates that all functions from the class are exported. The warning is that you can potentially call a non exported function from the base class, e.g.: struct public Base { void Foo1(); //impl. in cpp }; struct __declspec(dllexport) Derived : public Base { void Foo2(); //impl. in cpp }; void Foo() { Derived d; d.Foo1(); //error, but at least a linker error d.Foo2(); } wkr, me _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users __________________________________________________________ Not happy with your email address?. Get the one you really want - millions of new email addresses available now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html
Yes okay, but how do you then export these methods from the base class if they appear in an external library (boost::exception in this case), without changing the external library? Cheers, Andrej
on M$ std::exception is exported. But even if I create a non exported base class, it seems that it still works calling virtual or inline functions. The 'what' fct from std::exception is virtual. wkr, me
participants (2)
-
Andrej van der Zee
-
gast128