How to solve “cannot open file 'LIBCD.lib' ” in visual studio 2008?

寵の児 提交于 2021-02-09 02:52:29

问题


trying to compile some code i downloaded, i get link error LNK1104: cannot open file 'LIBCD.lib'. i cant find this file anywhere on my computer. what is it, and can i download it from somewhere? is there another way to get the code to work?


回答1:


The first hit on Google for libcd says:

This file is the static library for the debug single threaded version of the C runtime. Visual Studio 2005 no longer supports this version of the C runtime: instead you need to use the multi-threaded version (libcmtd.lib) or the dynamically linked (DLL) version (msvcrtd.lib).

To fix this problem you will need to change the makefile that comes with GLUI to get it to use a different version of the library.

and some other things that might help you.




回答2:


In my case, I only wrote "LIBCD.lib" in Configuration Properties -> Linker -> Input -> Ignore Specific Library




回答3:


You can fix this from the project settings. You need to add the /NODEFAULTLIB to the linker settings:

core.2f.nodefaultlib.asp">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/core.2f.nodefaultlib.asp

This option will make the linker ignore all the /DEFAULTLIB directives - this will remove the dependency on libcd.lib. Unfortunately it will remove all the other dependencies as well so you will need to explicitly add the libraries you do need (like glut32.lib etc.) as inputs to the linker.



来源:https://stackoverflow.com/questions/7183665/how-to-solve-cannot-open-file-libcd-lib-in-visual-studio-2008

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