Visual Studio .NET 2003 - Ignore Specific Library for libcmt vs libcmtd

吃可爱长大的小学妹 提交于 2019-12-11 01:39:55

问题


I have a template VS .NET 2003 project, which colleagues copy and customise when developing their software.

It appears the template was altered a while back to set the IgnoreSpecificLibrary property to have libcmt.lib for both release and debug builds (i.e. for both release and debug, the build should ignore libcmt.lib in the linker).

Some projects based on this have since been built, with the release build pulling in libcmtd.lib (evident by looking through the project .map file) which appears to have caused some runtime issues (i.e. a dialog window being flashed up as though a breakpoint had been set).

Does setting IgnoreSpecificLibrary to exclude libcmt.lib automatically make the project link against libcmtd.lib?

What is weird is that building the template (with the incorrect setting) links against libcmt.lib whereas some of the customised projects (though not all) link against libcmtd.lib.

Any ideas?


回答1:


This is what happened:

After compiling the linker takes your object-files and create among others a symbol table ,which has symol-request that have not been fullfilled. Then the linker goes through your list of libraries trying resolve those unfullfilled symbols. Since you ignore libcmt.lib ,your third-party library has left or added some unresolved symbols and it contains a linker request to resolve those from licmtd.lib (and maybe other libs as well) ,since it was compilled with debug option.

If you hadn't ignored libcmt.lib those symbols would most likely be resolved by libcmt.lib and there was no need to pull in stuff from libcmtd.lib (even though it would be looked at to resolve other symbols that were still unfullfilled)

You may try to igmore libcmtd.lib also. If you now get unresolvd externals then it was probebly no a good idea to ignore libcmt.dll.




回答2:


Many projects ignore the libcmt.lib, because it conflicts with the dynamic version msvcrt.lib. Ignoring libcmt in the linker make the project compile with msvcrt.lib



来源:https://stackoverflow.com/questions/4344569/visual-studio-net-2003-ignore-specific-library-for-libcmt-vs-libcmtd

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!