1

I have seen that some people encourage using STL libraries since they are optimised and you don't need to write all the code yourself, however, in dynamic libraries (DLLs) people do not encourage using them because the DLL could have been build with a different version of the library that other program which uses the DLL has. So my question is, in dynamic libraries can STL libraries be used and writing your own libraries will make DLLs cause less errors in other systems?

Salty 27
  • 91
  • 6
  • 1
    Specifically the selected [answer](https://stackoverflow.com/a/5664491/421178) – Casey Apr 26 '21 at 18:14
  • @Casey Yeah! Thanks for showing me that question and that answer! I was really confused since many people suggested using STL but I did not know if it was really a good practice. – Salty 27 Apr 26 '21 at 18:19
  • I admit to being paranoid and I also find myself having to support different languages sooner or later. As soon as you get different languages, you're stuck to moving Plain Old Data around. Arrays of fundamental types, null-terminated strings, and pre-agreed-upon data structures made up of fundamental types. I don't think I've ever made a library that lasted very long and had any standard library data types in the API. – user4581301 Apr 26 '21 at 18:25
  • You can use them as long as you make sure that anyone using your dll are using the same stl implementation. Although with that said they may need to use it anyways because of incompatibilities between the runtime. Visual Studio 2015 to 2019 are compatible with each other but no other version of VS. This is one reason why you will see binaries for multiple compilers produced for third party projects. – drescherjm Apr 26 '21 at 18:38

0 Answers0