Using glui32.lib for latest Visual Studio (Fix for error LNK1104: cannot open file 'LIBCD.lib')

Solutions for fixing Visual Studio error while building with OpenGL lib
(error LNK1104: cannot open file 'LIBCD.lib')

While building Visual Studio Project with OpenGL library such as
glu32.lib
glui32.lib
glut32.lib
opengl32.lib

The glui32.lib library links the libcd.lib library, which is not supported on Visual Studio later to the version 6.0.

Method 1: Should Use glui32.lib library, which links to libcmtd.lib library instead libcd.lib.
Method 2: Rebuild GLUT library from Source (http://glui.sourceforge.net/)
Method 3: Workaround in Visual Studio project property setting

Solution for Method 3

  • Right click the Project and choose Properties.

  • Open Configuration Properties --> C/C++ --> Preprocessor.
    • In the Preprocessor Definitions entry, add GLUT_BUILDING_LIB.
    • In the Runtime Library entry, choose Multi-threaded (/MT) or Multi-threaded Debug (/MTd).

  • Open Configuration Properties --> Linker -->Input.
    • In the Additional Dependencies entry, add glu32.lib;glui32.lib;glut32.lib;opengl32.lib.
    • In the Ignore Specific Default Libraries entry, add libcd.lib.

Share this

Related Posts

Previous
Next Post »