C4251 needs to have dll-interface
This might be more of a windows question, but... Everytime I use a boost template as part of a class interface that is exported from a dll, I get this compiler warning. For example I just cut and paste the TcpServer example from boost::asio::ip::tcp into a test project dll. I get: warning C3251: 'boost_enable_shared_from_this<T>::weak_this_':class 'boost::weak_ptr<T> ' needs to have a dll-interface to be used by clients of class 'boost::enable_shared_from_this<T>' It comes from the line: class __declspec(dllexport) TcpConnection : public boost::enable_shared_from_this<TcpConnection> { public: typedef boost::shared_ptr<TcpConnection> SmartPtr; . . . }; How do I solve these types of errors? Currently, I just include the correspnding boost header in the client project and igore the warnings, but I'd really like to get rid of them. Should I be including the boost headers and library in the client project? Doesn't the client project get what it needs from the dll, when the dll includes the headers and library?
participants (1)
-
Christopher Pisz