c++openglvisual-studio-2012

lnk1104: cannot open 'LIBC.lib' LINK


After writing a shader using GLee to my OpenGL project and compiling, I received the error LNK1104: cannot open file 'LIBC.lib'. I've tried adding it and ignoring it as others suggested, but not nothing resolved the issue. Is there an alternative way to solve this that I've missed?


Solution

  • Here are several possible solutions:

    1. This may due to code generation conflict. If your libc.lib's thread support is different then your project's settings, this may be causing the problem. If so, right click project, then go to properties->C++->code generation->Runtime Library and change the value to Multi-threaded(MT).

    2. Your libc.lib may not support multi threading. Right click project, then go to properties->Linker->Input->Additional Dependencies and change libc.lib to libcmt.lib

    3. Your application statically link multiple copies of the same library. Right click project, then go to properties->Linker->Input->Ignore Specific Library and add libc.lib

    4. Maybe your project needs this lib, but your system doesn't have it. In that case, you have to download the .lib file from Microsoft and add the path of where you downloaded it by right clicking project, then going to properties->Linker->General->Additional Library directories.