Okay I know that multi-threaded mode in visual studio links to the c runtime libraries through a dll...
and multi-threaded dll mode links the c runtime directly into your app staticly?? right???
because I noticed when I chose multi-threaded, it needed msvc80.dll or something to run...
am I right?
But what I don't understand is the name. I mean if its called multi-threaded dll you would think it means that it puts the c runtime into a dll and makes the app dependent on the dll. but its the other way around. odd.
multi-threaded dll?
I think you are probably confused. Multithread is supposed to link agains the static lib and Multithread Dll should link against the dll. Here is the list of runtime library selections and what they map to...
- Multithreaded (/MT, release static)
- Multithreaded Debug (/MTd, debug static)
- Multithreaded Dll (/MD, release dll)
- Multithreaded Debug Dll (/MDd, debug dll)
- Singlethread (/ML, release static)
- Singlethread Debug (/MDd, debug static)
Code: Select all
C:\>type b.cpp
#include <stdio.h>
int main(void)
{
return printf("hello world!\n"), 0;
}
C:\>cl /nologo /MT b.cpp
b.cpp
C:\>dumpbin /imports b.exe | find /i "dll"
KERNEL32.dll
C:\>cl /nologo /MD b.cpp
b.cpp
C:\>dumpbin /imports b.exe | find /i ".dll"
MSVCR70.dll
KERNEL32.dll
C:\>
-
Guest
-
Guest
-
Guest
okay, I discovered something interesting. Apparently, you have to have mvsc80.dll to run any application made in visual c++ express. I read on msdn that there is no support for statically linked c runtimes for visual express. which blows. which also means you will have to give people the vc 8 redistributable... which sucks. I'm gonna stick with codeblocks and mingw. Only because I'm more used to it. and so on. but when I learn more about vc express. I may switch back. can anyone prove me wrong about this?