STL run time link problem ( MSVC ABI )

We have a contributor who is working on porting CopperSpice to compile with MSVC 2017 and/or the clang Windows ABI compatible tool chain. There seems to be a potential problem and we are not sure if this is serious. Options: some wonderful person points us to a workaround, there is a decent solution using the clang front end, jump up and down and hope MS will correct this.

In our library we have a templated class with a data member whose type is std::deque<T>. This class is in "lib_a.dll" and is used in "lib_b.dll" and the main executable.

We have read/been told the following: "The only STL container that can currently be exported is std::vector. The other containers ( map, set, queue, list, deque) all contain nested classes and can not be exported." So according to MSDN docs it is impossible to export the STL containers, like deque. Does this limitation exist in clang when using the MSVC compatible ABI on Windows?

Something does not add up here and I will admit I am not sure I fully understand the problem. Our hope is that someone can see through this issue and help us define the real problem and offer a suggestion.

Any ideas or a potential direction is appreciated.

Barbara

Haven’t used msvc in a while, but if I remember correctly, each dll has it’s own heap, so you can’t allocate in one and delete in another — unless you buy the professional version.

Not sure if this applies, but hope it helps…
don

I think this article provides good explanation of complexities you may face with STL classes as well as possible solution for the problem.

https://www.codeproject.com/Articles/28969/HowTo-Export-C-classes-from-a-DLL))

In short all classes anyhow related to exported class are to be explicitly exported as well including alocators, iterators and inner classes related to implementation.

Regards,
Serge Preis.