Skip to content

libc.lib linker errors in Visual Studio 2010

2010 October 4
by Daniel

Playing around with the SuperBible code in VisualStudio 2010, and finding things… quirky. To say the least. Oddities like projects linking only where gltools.lib and freeglut_static.lib are added to the project explicitly – even where the folders containing these library files have been added to the library path. Hmmm.

But the oddest was when testing this out – by adding and removing the .lib files from a test project to see what happened. At somepoint, I added the lib files back to the project to get a new linker error… this time the dreaded

fatal error LNK1104: cannot open file 'LIBC.lib'

This was very unexpected as I had effectively put the project back to its initial state… and was now getting an error that hadn’t cropped up before.

Sorting this requires delving back into either the project properties or (better yet) the user property dialogs (as described in Adding the GLTools library). Select Linker -> Input, and where you see the option for Ignore Specific Default Libraries, enter libc.lib.

Problem sorted.

2 Responses leave one →
  1. April 25, 2011

    Hi Daniel,

    On my vs2010, i’ve discovered that i needed to exclude the msvcrtd.lib in addition to libc.lib

    Appreciate it if you can drop me a mesg if you know why.

    Nice work on the post :)

  2. AliSH permalink
    May 15, 2011

    Hi
    thanks for help..

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS