dynamically linked STL
-
HI all, Is it possible to link STL dynamically to my application? For me it is a bit confusing as template libraries are shipped as source. Hence making those in a DLL does not make sense. Please correct me if I am wrong. The real problem here is I have a static library produced my latest compiler which uses STL. Now If my client want to use it this library with compiler of lower version, it gives STL class undefined error. Please help. ~ Vikram S
-
HI all, Is it possible to link STL dynamically to my application? For me it is a bit confusing as template libraries are shipped as source. Hence making those in a DLL does not make sense. Please correct me if I am wrong. The real problem here is I have a static library produced my latest compiler which uses STL. Now If my client want to use it this library with compiler of lower version, it gives STL class undefined error. Please help. ~ Vikram S
vikrams wrote:
Is it possible to link STL dynamically to my application? For me it is a bit confusing as template libraries are shipped as source. Hence making those in a DLL does not make sense.
Right.
vikrams wrote:
The real problem here is I have a static library produced my latest compiler which uses STL. Now If my client want to use it this library with compiler of lower version, it gives STL class undefined error.
:confused: I don't get you here: using a static library (so, basically a collection of functions and/or classes in executable format) should have nothing to do with such an error... :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
HI all, Is it possible to link STL dynamically to my application? For me it is a bit confusing as template libraries are shipped as source. Hence making those in a DLL does not make sense. Please correct me if I am wrong. The real problem here is I have a static library produced my latest compiler which uses STL. Now If my client want to use it this library with compiler of lower version, it gives STL class undefined error. Please help. ~ Vikram S
But... ... the template sources (the only used) must be compiled, there is no any template LIB/DLL in the nature... :)
virtual void BeHappy() = 0;
-
vikrams wrote:
Is it possible to link STL dynamically to my application? For me it is a bit confusing as template libraries are shipped as source. Hence making those in a DLL does not make sense.
Right.
vikrams wrote:
The real problem here is I have a static library produced my latest compiler which uses STL. Now If my client want to use it this library with compiler of lower version, it gives STL class undefined error.
:confused: I don't get you here: using a static library (so, basically a collection of functions and/or classes in executable format) should have nothing to do with such an error... :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]so if my static library is compiled with newer version of compiler and my client uses it in its code which is compiled with older version of compiler. Things should work fine? This problem statment utimately boils down to 1) I have one static libray say "A" build with Compiler 2.0, uses STL 2) I have another static library "B" compiled with Compiler 1.0 uses STL If I try to make my client application with Compiler 1.0. using both the libraries(A and B), will it work? Does linker allows me to link two libraries carrying different STL instances? Can there be ambiguities or optimization issues? ~ Vikram S
-
HI all, Is it possible to link STL dynamically to my application? For me it is a bit confusing as template libraries are shipped as source. Hence making those in a DLL does not make sense. Please correct me if I am wrong. The real problem here is I have a static library produced my latest compiler which uses STL. Now If my client want to use it this library with compiler of lower version, it gives STL class undefined error. Please help. ~ Vikram S
vikrams wrote:
Is it possible to link STL dynamically to my application?
No, because you should not use STL across library boundaries...without really knowing what you do. First of all is STL not a binary compatible interface, you must compile with exactly the same STL version in all modules/libraries/DLLs. There is probably no linker warning/error if you try otherwise. Secondly allocating memory in one module's heap and deallocating in another will fail, if you do not provide special allocators. In short, there is no easy way to use STL in exported interfaces. Some more background: The Old New Thing: Allocating and freeing memory across module boundaries[^] Hope it helps! :) /M
Webchat in Europe :java: Now with 26% more Twitter