Re: link with C runtime library
"George" wrote:
1. How could I know if a project whether DLL or EXE or static
lib is linked
with C Runtime library?
Look in project's settings: C/C++ -> Code Generation -> Runtime
Library. Alternatively, look at resulting command line. There will
be one of /Mxxx switches.
2. Why we need C Runtime library in a C++ project? We need to
call some
legacy C functions like printf other than pure C++ functions
std::cout?
Because C++ relies on CRT in many ways. This is not only legacy
functions. C++ compiler generates a lot of code that assumes the
presence of CRT. Compiler and CRT are tightly coupled. You brought
the relevant citation from MSDN by yourself: CRT calls objects'
destructors and constructors, participates in implementation of
C++ exceptions mechanism etc.
3. If we use default entry point in DLL (DllMain), does it mean
C Runtime
Library is dynamically linked?
No, it doesn't mean anything. You need specify explicitly in
project's settings what flavor of CRT you want to use.
HTH
Alex