Boost logo

Boost Users :

Subject: [Boost-users] [Thread] Win32 TLS problem with dynamic libraries
From: óÅÒÇÅÊ úÁÈÁÒÞÅÎËÏ (szakharchenko_at_[hidden])
Date: 2012-10-25 09:07:31


Hello,

I need to build a shared plugin library with Boost libraries linked
statically into it. As many may know, there's a problem with
having a .tls section in Win32 dynamic libraries which are to be
loaded via LoadLibrary, but Boost.Thread insists on having one.
Assuming that I can guarantee that no Boost.Thread functions
are called from non-Boost.Thread threads, it shouldn't be
needed. Apart from patching the Boost.Thread sources, or
the resulting binaries, what's the best way of eliminating it?

I assume that I need to eliminate tss_pe.cpp from linkage,
but I don't seem to be able to. Adding a

namespace boost { void tss_cleanup_implemented() {} }

to one of the library's sources doesn't help, as it results in a
multiply defined symbol error (compiler MSVC2008 from
Express edition).

Any suggestions? Thank you,

-- 
Sergey Zakharchenko

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net