
I just tried compiling some source code in Microsoft VS 2005, with /clr turned on. It turned up the following error: boost/serialization/void_cast_fwd.hpp(26) : error C3389: __declspec(dllexport) cannot be used with /clr:pure or /clr:safe It appears that BOOST_DLLEXPORT, defined in boost/serialization/force_include.hpp, is always defined to __declspec(export). This is surely incorrect, is it not? The reason I bring this up is that it resolved a mysterious build "issue" I'd been having ever since I started using serialization (which occurs with native code generation on VC++): even though I only used serialization in an executable (i.e., the source got compiled to a .exe), the compiler was also producing an import library and export file, as it would for a DLL! I am guessing that this is due to the fact that functions are being "exported" from the executable via BOOST_DLLEXPORT. Sure enough, if I removed serialization from my source code, the exp and lib files disappeared. While this might only be slightly annoying, I can't help but think that the semantics of __declspec(dllexport) within a non-DLL are undefined at best. I don't know enough about the serialization library to understand this problem in enough detail to offer an alternative.