VC的配置问题
一个多线程程序
在Project Setting -> C/C++ -> CodeGeneration -> Use Run-time library
里无论选择Multithreaded 或者 Multithreaded DLL都可以正常运行.
请问这两个选项有什么区别?
更头痛的是讲这种VC配置的书或者网上资料都很少,而实际做项目的过程中,这些配置又是极易引发错误的.
求助!
问题点数:20、回复次数:6Top
1 楼phoenix96_2000(Arcrest)回复于 2005-09-21 15:54:15 得分 12
multithreaded dll的会使得最后的exe对msvcrt.dll有依赖Top
2 楼phoenix96_2000(Arcrest)回复于 2005-09-21 15:56:35 得分 0
/MT Defines _MT so that multithread-specific versions of the run-time routines are selected from the standard header (.h) files. This option also causes the compiler to place the library name LIBCMT.lib into the .obj file so that the linker will use LIBCMT.lib to resolve external symbols. Either /MT or /MD (or their debug equivalents /MTd or /MDd) is required to create multithreaded programs.
/MD Defines _MT and _DLL so that both multithread- and DLL-specific versions of the run-time routines are selected from the standard .h files. This option also causes the compiler to place the library name MSVCRT.lib into the .obj file.
Applications compiled with this option are statically linked to MSVCRT.lib. This library provides a layer of code that allows the linker to resolve external references. The actual working code is contained in MSVCR71.DLL, which must be available at run time to applications linked with MSVCRT.lib.
Top
3 楼jjiaming(阿熊)回复于 2005-09-21 15:57:03 得分 3
搬条板凳,坐下学习Top
4 楼i_noname(晚九朝五)回复于 2005-09-21 15:59:08 得分 5
也就是静态链接和动态链接的区别。
Multithreaded是静态的
Multithreaded DLL是动态的Top
5 楼iamwiner(烛泪)回复于 2005-09-21 16:29:14 得分 0
哪儿有系统的介绍?Top
6 楼phoenix96_2000(Arcrest)回复于 2005-09-22 08:43:23 得分 0
msdn
knowledge baseTop




