Is it possible to use distinct libraries A,开发者_Python百科 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?)
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.
精彩评论