So, I'm trying to compile a DLL for a large project of of mine. The idea is for it to have several parts. A library, of sorts, which gets compiled into a DLL, and an application that the DLL gets linked into. I keep getting the following warning:
warning C4251: 'plf::lfInvalidIndexExcpt::message': class 'boost::container::basic_string<char,std::char_traits<char>,boost::container::new_allocator<char>>' needs to have dll-interface to be used by clients of class 'plf::lfInvalidIndexExcpt'
Here is the code that has been giving me trouble.
I have my DLL export/import macro defined as follows:
#ifdef LF_ENGINE_EXPORTS
#define LFE_API __declspec(dllexport)
#else
#define LFE_API __declspec(dllimport)
#endif
Now, I'm using boost with my library and at one point I have the following:
typedef boost::container::string lfString;
The class lfInvalidIndexExcpt is defined like this:
namespace plf
{
class LFE_API lfInvalidIndexExcpt
{
public:
explicit lfInvalidIndexExcpt(lfSize idx);
lfInvalidIndexExcpt(lfSize idx, const lfString& descr);
const char* what() const throw();
private:
lfString message;
void makeMessage(lfSize idx, const lfString& descr);
};
};
I should probably mention that lfSize is just a typedef for std::size_t.
All I'm wondering is what this warning actually means and if I can use Boost like this in my DLL, if at all. Also, if this is not the proper way to use Boost what is?
Thanks,
-Zack Frost