On Wed, Apr 29, 2015 at 4:40 PM, Fu ji
Maybe it's because in solutionB I have delaration of tls (in other way I have problem with building solution:
file.obj : error LNK2001: unresolved external symbol "public: static class boost::thread_specific_ptrclassnamespace::CClass namespace::CThreadLocalStorageSlot::ThreadLocalStorage_" (?ThreadLocalStorage_@CThreadLocalStorageSlot@tnamespace@ @2V?$thread_specific_ptr@VCThread@namespace@@@boost@@A)
)
You have to declare the TLS variable in the header, it has to have external linkage. Given that you have two dlls, it must also be exported. For example: // tls.h extern API boost::thread_specific_ptr<int> TLS; Then you have to define this object in one cpp file of SolutionC, like this: // tls.cpp #include "tls.h" API boost::thread_specific_ptr<int> TLS; Here API is a macro which is defined to __declspec(dllexport) when you build SolutionC and __declspec(dllimport) otherwise. PS: This is really not a Boost-related question. You need to understand how linking works on Windows in general.