How to solve warnings that appear when building my DLL...
As it may be apparent from my previous thread, I am trying to get 'making my own DLLs' sorted out. I ran into a problem when I was building my DLL yesterday (which just contains a few classes). Some of my classes have members that are of the type 'std::string', and while the DLL builds without errors, numerous warnings appear. These are all of the following form:
I understand why these warnings are occurring, as a client program is not guaranteed to have included <string>, which defines the basic_string class, and so is not guaranteed to be able to use the 'name' member of the Device class for example, in the case above. I do not know however, how to get rid of these warnings, without simply ignoring or disabling them. There has got to be a way around this...
c:\Program Files\Webots\include\controller\mycpp\webots\Device.hpp(34) :
warning C4251: 'webots::Device::name' : class 'std::basic_string<_Elem,_Traits,_Ax>' needs
to have dll-interface to be used by clients of class 'webots::Device'
And just for the record, I use MSVC++ 2003.