unwanted exported symbols in a DLL which statically links to Boost.Library

Hello,
I am creating a DLL using the VisualC++ 8sp1, which statically links to
Boost.Library, and also to another static library, which links to
Boost.Library statically too.
In the export section of the built DLL I see, among the few public
functions which it should export, hundreds of exported functions like the
ones below. I would really like to export the symbols the DLL defines as
exported, and not anything else which is unexpectly exported, like the
ones shown below:
boost::archive::detail::oserializer ::oserializer boost::archive::detail::oserializer ::oserializer boost::archive::detail::oserializer ::oserializer In my static library, which statically link to the Boost.Serialization
library, I have the following code which explicitly instantiate some
template type on a set of a priori known datatypes:
template MYLIB_API struct sqy::Vector2<int>;
template MYLIB_API struct sqy::Vector2<float>;
template MYLIB_API struct sqy::Vector2<double>;
template MYLIB_API struct sqy::Vector2

so i wonder where those symbols above comes from?
The serialization library contains code which most optomisers will discard as it is not explicitly referenced. This was discovered when applications built and tested with "debug" failed when built with "release". The solution was to add "export" declarations to these functions so that the optimiser wouldn't discard them.
Anyone could help me to remove from the DLL exporting section those unwanted symbols?
This is implemented by "force_include.hpp". If you alter this header so that the defines don't do anything, you might be able to eliminate the exported symbols, but I wouldn't expect the library to work when compiled in release mode. Good Luck Robert Ramey Luca Cappa wrote:
Hello,
I am creating a DLL using the VisualC++ 8sp1, which statically links to Boost.Library, and also to another static library, which links to Boost.Library statically too.
In the export section of the built DLL I see, among the few public functions which it should export, hundreds of exported functions like the ones below. I would really like to export the symbols the DLL defines as exported, and not anything else which is unexpectly exported, like the ones shown below:
boost::archive::detail::oserializer
oserializer
(void) boost::archive::detail::oserializer
oserializer
(void) boost::archive::detail::oserializer
oserializer
(void) In my static library, which statically link to the Boost.Serialization library, I have the following code which explicitly instantiate some template type on a set of a priori known datatypes:
template MYLIB_API struct sqy::Vector2<int>; template MYLIB_API struct sqy::Vector2<float>; template MYLIB_API struct sqy::Vector2<double>; template MYLIB_API struct sqy::Vector2
; #define INSTANTIATE_VECTOR2_SERIALIZATION(x)\ template void MYLIB_API Vector2<x>::serializeboost::archive::xml_oarchive (\ boost::archive::xml_oarchive&, const unsigned int);\ template void MYLIB_API Vector2<x>::serializeboost::archive::xml_iarchive (\ boost::archive::xml_iarchive&, const unsigned int);
INSTANTIATE_VECTOR2_SERIALIZATION(int); INSTANTIATE_VECTOR2_SERIALIZATION(float); INSTANTIATE_VECTOR2_SERIALIZATION(double); INSTANTIATE_VECTOR2_SERIALIZATION(size_t);
Notice that, when the DLL is created, MYLIB_API is defined like
# define MYLIB_API
so i wonder where those symbols above comes from? Anyone could help me to remove from the DLL exporting section those unwanted symbols?
Many thanks in advance, Luca
participants (2)
-
Luca Cappa
-
Robert Ramey