Here goes nothing... please chime in if you find a mistake.
1. Is there a difference between "C/C++ Runtime Library" and "C/C++ Standard Library"?
Yes and no. Sometimes people use runtime library to mean everything and ignore standard library altogether (for Microsoft tools). However, technically, the runtime library is loaded at runtime, so it includes the pair .lib (import lib) and .dll. See here for details: http://msdn.microsoft.com/en-us/library/vstudio/abx4dbyh(v=vs.100).aspx
Technically, the libc* are standard libraries and the *crt are runtime libraries.
2. How do I know if the "C/C++ Runtime Library" library is statically or dynamically linked to the project?
If you're using the IDE (VS2010, others are similar), this is in project properties:
- configuration properties
- c/c++
- code generation
[Runtime Library]
3. How do I know where this library is located in the filesystem?
The lib files are in the lib dir of your sdk (if you installed a later windows sdk) or the Visual C++ directory.
4. In case, the "C/C++ Runtime Library" is dynamically linked to the project, how can I know which ".dll" is used and where the used ".dll" is located in the filesystem?
You can figure out which ones are used by using the depends tool. http://www.dependencywalker.com/
The DLLs are somewhere in the Windows directory. They move them around and it's now in funky places with manifests and stuff to keep track of version. I wouldn't worry about this too much. If you have to worry about this, something's probably wrong. For details:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa375365(v=vs.85).aspx
http://en.wikipedia.org/wiki/Side-by-side_assembly
If this is a concern, you can bundle a redistributable package with your installer: Difference between Visual Studio Redistributable and Visual Studio SP1
5. Suppose that I statically link the "C/C++ Runtime Library" to the project, can I be sure that the executable generated from the source code will work on all Windows Platforms (XP/Vista/Seven/..., 32 bit/64 bit)?
Yes, if you link statically, then you're safer in terms of not being able to find the dll. However, this makes your executable larger. There are other consequences in terms of behavior... It's difficult to enumerate, but the difference comes from the fact that the library is in a dll vs compiled into your exe.
6. What are the advantages/drawbacks of dynamically linking the "C/C++ Runtime Library" to the project?
Why use dll:
a - size. smaller exe size because all the library stuff is in the dll which are supposed to have been installed already on the user's system, although this is sometimes not true.
b - If there are bugs in the runtime, Microsoft can push a new release down to the user. You don't have to deal with it. If you statically link, you have to push a new exe to the user.
Why not to use dll:
a - many issues with dealing with dll. If you forget to bundle the redist, many problems can show up.
b - having more dlls to load and unload causes slower start up and exit time.
Probably other reasons that I haven't thought of...
7. Should the "C/C++ Runtime Library" rather be statically or dynamically linked to the project?
It really depends. I personally prefer statically linked. I hate scrambling around looking for the right redist/dll/etc.
vc_redists
, so I have no reason not to expect it is/can be installed. – Gynophore