Is it possible to use distinct libraries A, B, C in the same project in Visual Studio, where A is a static library, B is multi-threaded and C is a multi-threaded DLL? Or do they all have to be the same type for a single .exe output?
Edit: Sorry, A is a single-threaded static library. B is a multi-threaded static library, C is a multi-threaded DLL. (I guess A and B are the same from the linker's point of view?)
Yes, the Core and Utils code will be duplicated.
When you want to “link a static library with dynamic library”, you really want to include the symbols defined in the static library as a part of the dynamic library, so that the run-time linker gets the symbols when it is loading the dynamic library.
It is also necessary to link to the static library (defined previously in this topic) or to the import libraries for the PLUS DLL Interface. An import library tells your EXE how to connect to the PLUS DLL during runtime. Import libraries for Microsoft Visual C++ 6.0 SP6 or later compilers are provided.
In computer science, a static library or statically-linked library is a set of routines, external functions and variables which are resolved in a caller at compile-time and copied into a target application by a compiler, linker, or binder, producing an object file and a stand-alone executable.
You can freely mix static and dynamic libraries, so long as they all use the same run-time libs.
In Properties -> General -> Configuration Type -> set this to Static Library or Dynamic Library for the libraries A and B you want to static or dynamic.
In Properties -> C/C++ -> Code Generation -> Runtime Library -> Every library which will be linked together must use the same run-time library, for example Multi-Threaded Debug DLL.
Thus you could do:
A - Config Type: Static Library. Runtime Lib: Multi-threaded Debug DLL. (yes this is ok)
B - Config Type: Dynamic Library. Runtime Lib: Multi-threaded Debug DLL
These two libs could be linked into the same exe.
Not sure what B is but the general idea is yes.
A will get compiled directly into the exe B Not sure about what this one is C Yes, functions within this library will be linked at runtime.
Are you talking about libraries compiler with different CRT linking type(static, dll)? If yes, then it's impossible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With