Re: link with C runtime library
- From: George <George@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 3 Feb 2008 17:19:51 -0800
Thanks Alex,
1.
Look in project's settings: C/C++ -> Code Generation -> Runtime
Library. Alternatively, look at resulting command line. There will
be one of /Mxxx switches.
I am using Visual Studio 2008. I have checked C/C++ -> Code Generation ->
Runtime Library /MT, /MTd, /MD and /MDd. Any differences between them?
2.
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.
ok. I have got your idea. We can not separate C and C++ libraries and they
are mixed together.
regards,
George
"Alex Blekhman" wrote:
"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
- Follow-Ups:
- Re: link with C runtime library
- From: Alex Blekhman
- Re: link with C runtime library
- References:
- Re: link with C runtime library
- From: Alex Blekhman
- Re: link with C runtime library
- Prev by Date: Re: virtual function not in vtable
- Next by Date: Re: link with C runtime library
- Previous by thread: Re: link with C runtime library
- Next by thread: Re: link with C runtime library
- Index(es):
Relevant Pages
|