none
LINK : fatal error LNK1104: cannot open file 'LIBCD.lib'

    Question

  • HI, I'm trying to install GLUI to work with Visual Studio 2005, i'm just trying to run one of the examples but i keep getting this error:

    LINK : fatal error LNK1104: cannot open file 'LIBCD.lib'

    the only reference i could find to it was in a microsoft help page but it said the bug had been fixed in an eariler version.

    Any help would be great.
    Cheers


    Tuesday, April 04, 2006 9:49 AM

Answers

All replies

  • 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.

    Tuesday, April 04, 2006 9:55 AM
  • I'm not sure what you mean, i've installed glui by putting the .h file and .lib file in the Visual studio directory, but i havent used a makefile that came with it. Will that be the problem? where should i put the makefile?


    Tuesday, April 04, 2006 10:03 AM
  • To get this error message you must be building a project: and something in the build process for the project is telling Visual Studio 2005 that it needs libcd.lib - this can either be in the project settings, in a makefile, or via an embedded linker directive in some object file (*.obj) or a library (*.lib).

    You need to track down where dependency on libcd.lib is coming from - this is pretty straightforward for the first two cases. For the third case you may need to pass the /verbose switch to the linker and then look through the ouput to see where the dependency on libcd.lib is coming from.

    Tuesday, April 04, 2006 10:19 AM
  • Ok, I've passed the /verbose switch into the linker and the only reference was:

    Linking...
    Starting pass 1
    Processed /DEFAULTLIB:msvcprtd
    Processed /DEFAULTLIB:winmm.lib
    Processed /DEFAULTLIB:opengl32.lib
    Processed /DEFAULTLIB:glu32.lib
    Processed /DEFAULTLIB:glut32.lib
    Processed /DEFAULTLIB:glui32.lib
    Processed /DEFAULTLIB:MSVCRTD
    Processed /DEFAULTLIB:OLDNAMES
    Searching libraries
    Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\glui32.lib:
    Found "public: void __thiscall GLUI_Master_Object::set_glutIdleFunc(void (__cdecl*)(void))" (?set_glutIdleFunc@GLUI_Master_Object@@QAEXP6AXXZ@Z)
    Referenced in main.obj
    Loaded glui32.lib(glui.obj)
    Processed /DEFAULTLIB:LIBCD
    ...
     

    Does this mean its a problem with the glui32.lib file? because i have no idea how to edit it (or even where to find the problem)
    Cheers

     
    Tuesday, April 04, 2006 11:15 AM
  • You can fix this from the project settings. You need to add the /NODEFAULTLIB to the linker settings:

    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.

    Tuesday, April 04, 2006 11:45 AM
  • I am having the same problem, actually.

    I know it's a long time later but I would like to say that I can't just ignore LIBCD.lib as suggested.

    This always results in numerous unresolved external symbols.

    Here are the errors I get when I tried what you suggested:

     

    main.obj : error LNK2019: unresolved external symbol __RTC_CheckEsp referenced in function _main
    main.obj : error LNK2001: unresolved external symbol __RTC_Shutdown
    main.obj : error LNK2001: unresolved external symbol __RTC_InitBase
    main.obj : error LNK2001: unresolved external symbol __fltused
    LINK : error LNK2001: unresolved external symbol _mainCRTStartup

     

    No matter what I've tried, I haven't been able to get glui or glut working.

     

    Saturday, October 07, 2006 12:42 AM
  • Try to set:

    Ignore specific Library in Linker instead of Igonre All Default Library

    Then, all problems should be solved.

    Thursday, April 19, 2007 3:08 PM
  • The same problem I am facing when I shifted from Microsoft visual studio 6 to Microsoft visual studio 8. But can anybody tell me how to Ignore specific Library in Linker instead of ignoring all default libraries?
    Wednesday, June 20, 2007 6:47 AM
  •  Gururaj wrote:
    The same problem I am facing when I shifted from Microsoft visual studio 6 to Microsoft visual studio 8. But can anybody tell me how to Ignore specific Library in Linker instead of ignoring all default libraries?
    Wednesday, June 20, 2007 6:54 AM
  • Hi,

     

    You can ignore a specific library by going to Project Properties->Linker->Input->Ignore Specific Library

    Enter the one you wish to ignore there.

     

     

    Wednesday, June 27, 2007 2:20 AM
  • Workaround of ignoring specific library is also not working.

    Can any one provide better & proven workaround?

     

    Thanks in advance..

     

     

    Aithal.

    Wednesday, June 27, 2007 5:13 AM
  •  

    Sorry to hear It doesn't work, but I am not sure what you mean. Do you mean it doesn't ignore the library, or it doesn't solve your linking problems?

    I had similar problems to yours (LIBCD.lib) while trying to link a ported GNU library, GSL.

    My linking problems stopped when I changed the Runtime Library to : Multi-threaded  /Mtd instead of the default Multithreaded DLL.

     

    Ignoring a specific library was possible the way I mentioned, but it didn't solve my problem.

    Monday, July 02, 2007 1:43 AM
  •  Jonathan Caves - MSFT wrote:

    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.

     

    Hello Moderator,

     

    I would really appreciate if you will provide me with the GLUI that works with Visual Studio 2005 Pro. I been trying out many ways but in vain.

     

    Thanks,

    -t

    Wednesday, September 05, 2007 9:51 AM
  • Hi, t-965,

     

    I think i'm trying to do the same thing with you.

     

    what previous answers are all right.

     

    you need to go:

     

     

    Project Property Pages -> configureation Properties -> Linker -> Input ->

    you'll see on right hand a list of options, one of which:

    "Ignore Specific Library": you type in exactly: LIBCD

     

    that will do it.

     

    JLP

    Monday, October 22, 2007 5:11 PM
  • I found this discussion while Googling, and found a better solution, so I figured i'd post an update for future searchers. If you use the flag /NODEFAULTLIB:"LIBCD.lib" you can exclude only the LIBCD.lib library. Much easier than removing all of them then manually linking them in after... Hopefully this will help someone.
    Thursday, October 25, 2007 5:22 PM
  • That was helpful....Thanks guys!!!!
    Thursday, November 01, 2007 10:45 PM
  • I read the topic and it was a big help, cause I had the same probleme.. I simply tryed the sugested:
    project properties- > configuration properties -> linker->input->ignore specific library ->and tiped in:    libcd.lib
    and it work.. thanks
    Tuesday, December 04, 2007 3:37 PM
  • Great!! I already fixed it.
    Thanks
    Monday, January 14, 2008 6:13 AM
  • Hi there!!

    I've just got the same problem, but none of the answers worked. I tried ignoring the library, but it got me an unresolved external symbol, and changing the runtime library doesn't work.

    I'm working in a OpenGL project in VC++ con VS 9 in windows vista, and I updated the windows SDK yesterday, but I really don't know what to do.

    Any other idea?

    Maika

    A question: How do I put the /verbose switch in the linker?
    Wednesday, January 16, 2008 2:08 AM
  • i am having the same problem.I used the verbose switch to isolate the problem. But the link error seems to persist. Ignoring alldefault libraries does not seem to work either. On doing that i get a load of unreferenced symbol errors.

    Any other suggestions?

    cheers

    Tuesday, February 26, 2008 12:03 AM
  •  

    So ! I was having the same problem for one week and I just had the solution now. Ignoring libcd.lib was not the solution because the problem come from my GLUI and GLUT files, they were corrupted. So, I have downloaded again these files and put them in the right place, and it works well !

    I expect it will resolve the problem of some people.

    Friday, March 28, 2008 9:52 AM
  • hey........
    ignoring specific library is givin unresolved external symbol errors.
    could you guys tell me how to change the runtime library?
    Thursday, October 02, 2008 4:43 AM
  • Hi ,

    I get this error :
    LINK : fatal error LNK1104: cannot open file 'opengl32.lib'


    I am using Visual C++ 2005 , in vista , and get this error , I tried the solutions you supplied but its not working , I also tried to set it in my project properties->linker--> inputs --> additional dependancies ->opengl32.lib  glu32.lib  glut32.lib
    also I checked my GLUT file it doesn't contatin this library !

    anyone know about this error?

    Thanks.
    Monday, March 30, 2009 6:45 PM
  • Hey Kithlepur
    Could you please provide the download link of OPenGL Libraries which work fro you It would be helpful.
    Sunday, June 07, 2009 1:01 AM
  • I got the same error. None of that /NODEFAULTLIB stuff worked.

    My solution was not to use a glui32.lib you find online. Instead I downloaded the source and rebuilt it myself from http://vis.eng.uci.edu/~jkimball/eecs205/glui.html. I used glui version 2.35. Like this you have the most recent version and it will work with newer version of VS and Windows. I'm in Vista with Visual Studio 9.

    ALSO, I needed to build glui32 using option /MT instead of /MD see http://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx. Without that I ran into other linker trouble discussed here: http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/a53f9b62-d4ef-433d-b486-94953a17d1c1

    (In my particular case I also needed to change from /MD to /MDd when rebuilding my own code)
    Thursday, July 02, 2009 6:49 PM
  • Thanks for that thread;
    It works for me trying to make a test code for Freetype 2.3.4 whose lib was compiled with VC6:

    With VC++ 2008 Express (french)
    > using option /MT instead of /MD    (->properties->C C++ -> code gen-> runtime lib )
    > just ignoring LIBCD.lib (because ignoring all is worse) (->properties ->linker-> entry -> spec lib ignored)


    Saturday, February 27, 2010 4:33 PM
  • Hi EveryOne....

    I got the bele msg wheni m runnin wat i supposed to do ?/

    Linking...
    LINK : fatal error LNK1104: cannot open file 'ippacemerged.lib'
    
    Wednesday, October 27, 2010 11:50 AM
  • You should not use someone else's thread to ask this question. (Yes, the error number is the same, but yours is failing for a different reason from this already solved one.)

     

    The most likely cause of that problem is that you have not updated the path that the linker looks in for library files. Specifically, it does not know where to find the library file 'ippacemerged.lib'. (This is a library from Intel...did you install it using their guidance?)

    At any rate, you need to add that path to the library path that is searched. (Under Tools/Options/Projects and Solutions/VC++ Directories/[Library Files])

    Wednesday, October 27, 2010 4:06 PM
  • Thanks for that thread;
    It works for me trying to make a test code for Freetype 2.3.4 whose lib was compiled with VC6:

    With VC++ 2008 Express (french)
    > using option /MT instead of /MD    (->properties->C C++ -> code gen-> runtime lib )
    > just ignoring LIBCD.lib (because ignoring all is worse) (->properties ->linker-> entry -> spec lib ignored)


    THIS IS THE ANSWER!

    GLUI is an older program written before the time of libraries commonly using dynamic library linking. It also uses the single threaded library LIBCD.lib which was a library designed for single threaded applications.

    If you want to use /MD, find a .dll file for GLUI. Guaranteed you aren't using one at the current time if you are getting linker errors not pertaining to LIBCD.lib.

    Secondly, exclude LIBCD.lib as it is a library for single-threaded application (no longer supported).


    • Edited by Kjell_S Sunday, October 20, 2013 6:14 AM Answer!
    Sunday, October 20, 2013 6:12 AM