If you have the following project structure:
-Shared
- Exe_Proj1
- Exe_Proj2
Which use the CRT in the following ways:
-Shared (Dynamic CRT /MD)
- Exe_Proj1 (Dynamic CRT /MD)
- Exe_Proj2 (Static CRT /MT)
Then how can you share the "Shared" project with "Exe_Proj2"?
I thought about using /NODEFAULTLIB in shared but this won't change the CRT setting under the "code generation" project settings area.
If
Shared
is a static library, you just can't do it. MakeExe_Proj2
use the dynamic CRT or die trying.If
Shared
is a dynamic library, it should work, as long as you don't pass anything that needs the CRT services (any C++ standard library type, file handles, etc.) between the libraries, but in this case the linker shouldn't complain.