[SOLVED] Cannot find libc.lib

Started by
5 comments, last by jonathanc 15 years ago
Hi all! I am trying to compile an example from Dave Astle's More OpenGL Programming book (the code can be downloaded free here : http://glbook.gamedev.net/moglgp/code.asp) . I am using vs2005. I noticed that I had to convert the project in order to open it. I also had some initial errors of some undefined variables (although they are already defined) So I fixed all that and finally managed to try to compile. I then get the single error "Cannot find libc.lib" I have googled and tried all the solutions and none seem to work. I can't even see libc.lib being included in the project. Among some things I have tried is to disable the the Buffer Security check, ignore default libraries, and also tried to download a compiled freeglut_static.lib and renaming it to libc.lib etc. None seems to work. I can compile other OpenGL projects fine though - the ones from NeHe for example. I am wondering if anyone have encountered the same problem and found a solution? Thanks. [Edited by - jonathanc on April 22, 2009 3:43:05 PM]
Advertisement
Right, I manually linked the project to my VS2005 lib folder which contains LIBC.dll.

got tons of errors but the first line is this:

1>LIBCMTD.lib(crt0init.obj) : warning LNK4098: defaultlib 'libc.lib' conflicts with use of other libs; use /NODEFAULTLIB:library

I tried /NODEFAULTLIB and I get even more errors :<

I also checked the project settings and libc.lib doesn't seem to be linked anywhere. What am I missing here ...
One of the libraries you are linking to is probably compiled against a different version of the C runtime (eg libc instead of libcmt). Ensure all libraries (at least statically linked ones) are compiled against the same runtime.
Anthony Umfer
In the linker settings I just add "libc.lib" to the "ignore" settings part.
Quote:Original post by CadetUmfer
One of the libraries you are linking to is probably compiled against a different version of the C runtime (eg libc instead of libcmt). Ensure all libraries (at least statically linked ones) are compiled against the same runtime.


Hmmm not sure what you mean there... can you please elaborate more?

Quote:Original post by Knuckler
In the linker settings I just add "libc.lib" to the "ignore" settings part.


I tried that too and got errors like these:
Quote:
1>CGLFontClass.obj : error LNK2019: unresolved external symbol __imp__glTexParameteri@12 referenced in function "public: bool __thiscall CGLFontClass::load(char *,char *)" (?load@CGLFontClass@@QAE_NPAD0@Z)
1>CHeightClass.obj : error LNK2001: unresolved external symbol __imp__glTexParameteri@12
1>CGLFontClass.obj : error LNK2019: unresolved external symbol __imp__glTexImage2D@36 referenced in function "public: bool __thiscall CGLFontClass::load(char *,char *)" (?load@CGLFontClass@@QAE_NPAD0@Z)
1>CHeightClass.obj : error LNK2001: unresolved external symbol __imp__glTexImage2D@36
1>CGLFontClass.obj : error LNK2019: unresolved external symbol __imp__glBindTexture@8 referenced in function "public: bool __thiscall CGLFontClass::load(char *,char *)" (?load@CGLFontClass@@QAE_NPAD0@Z)
1>CHeightClass.obj : error LNK2001: unresolved external symbol __imp__glBindTexture@8
1>CGLFontClass.obj : error LNK2019: unresolved external symbol __imp__glGenTextures@8 referenced in function "public: bool __thiscall CGLFontClass::load(char *,char *)" (?load@CGLFontClass@@QAE_NPAD0@Z)
1>CHeightClass.obj : error LNK2001: unresolved external symbol __imp__glGenTextures@8
1>CGLFontClass.obj : error LNK2019: unresolved external symbol __imp__glDeleteTextures@8 referenced in function "public: bool __thiscall CGLFontClass::load(char *,char *)" (?load@CGLFontClass@@QAE_NPAD0@Z)
1>CHeightClass.obj : error LNK2001: unresolved external symbol __imp__glDeleteTextures@8
1>CGLFontClass.obj : error LNK2019: unresolved external symbol __imp__glHint@8 referenced in function "public: bool __thiscall CGLFontClass::load(char *,char *)" (?load@CGLFontClass@@QAE_NPAD0@Z)
1>CGLFontClass.obj : error LNK2019: unresolved external symbol __imp__glTexEnvi@12 referenced in function "public: bool __thiscall CGLFontClass::load(char *,char *)" (?load@CGLFontClass@@QAE_NPAD0@Z)
1>CGLFontClass.obj : error LNK2019: unresolved external symbol __imp__glEnable@4 referenced in function "public: bool __thiscall CGLFontClass::load(char *,char *)" (?load@CGLFontClass@@QAE_NPAD0@Z)
1>CGLFontClass.obj : error LNK2019: unresolved external symbol __imp__gluPerspective@32 referenced in function "public: void __thiscall CGLFontClass::display(char *,int,int,float)" (?display@CGLFontClass@@QAEXPADHHM@Z)
1>CHeightClass.obj : error LNK2001: unresolved external symbol __imp__gluPerspective@32
1>MGLApp.obj : error LNK2001: unresolved external symbol __imp__gluPerspective@32
1>CGLFontClass.obj : error LNK2019: unresolved external symbol __imp__glEnd@0 referenced in function "public: void __thiscall CGLFontClass::display(char *,int,int,float)" (?display@CGLFontClass@@QAEXPADHHM@Z)
1>CHeightClass.obj : error LNK2001: unresolved external symbol __imp__glEnd@0
1>CGLFontClass.obj : error LNK2019: unresolved external symbol __imp__glVertex2f@8 referenced in function "public: void __thiscall CGLFontClass::display(char *,int,int,float)" (?display@CGLFontClass@@QAEXPADHHM@Z)
1>CHeightClass.obj : error LNK2001: unresolved external symbol __imp__glVertex2f@8
1>CGLFontClass.obj : error LNK2019: unresolved external symbol __imp__glTexCoord2f@8 referenced in function "public: void __thiscall CGLFontClass::display(char *,int,int,float)" (?display@CGLFontClass@@QAEXPADHHM@Z)
1>CHeightClass.obj : error LNK2001: unresolved external symbol __imp__glTexCoord2f@8
1>CGLFontClass.obj : error LNK2019: unresolved external symbol __imp__glBegin@4 referenced in function "public: void __thiscall CGLFontClass::display(char *,int,int,float)" (?display@CGLFontClass@@QAEXPADHHM@Z)
1>CHeightClass.obj : error LNK2001: unresolved external symbol __imp__glBegin@4
1>CGLFontClass.obj : error LNK2019: unresolved external symbol __imp__glColor4f@16 referenced in function "public: void __thiscall CGLFontClass::display(char *,int,int,float)" (?display@CGLFontClass@@QAEXPADHHM@Z)
1>CHeightClass.obj : error LNK2001: unresolved external symbol __imp__glColor4f@16
1>CGLFontClass.obj : error LNK2019: unresolved external symbol __imp__glBlendFunc@8 referenced in function "public: void __thiscall CGLFontClass::display(char *,int,int,float)" (?display@CGLFontClass@@QAEXPADHHM@Z)
1>CGLFontClass.obj : error LNK2019: unresolved external symbol __imp__glOrtho@48 referenced in function "public: void __thiscall CGLFontClass::display(char *,int,int,float)" (?display@CGLFontClass@@QAEXPADHHM@Z)
1>CHeightClass.obj : error LNK2001: unresolved external symbol __imp__glOrtho@48
1>CGLFontClass.obj : error LNK2019: unresolved external symbol __imp__glLoadIdentity@0 referenced in function "public: void __thiscall CGLFontClass::display(char *,int,int,float)" (?display@CGLFontClass@@QAEXPADHHM@Z)
1>CHeightClass.obj : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
1>MGLApp.obj : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
1>CGLFontClass.obj : error LNK2019: unresolved external symbol __imp__glMatrixMode@4 referenced in function "public: void __thiscall CGLFontClass::display(char *,int,int,float)" (?display@CGLFontClass@@QAEXPADHHM@Z)
1>CHeightClass.obj : error LNK2001: unresolved external symbol __imp__glMatrixMode@4
1>MGLApp.obj : error LNK2001: unresolved external symbol __imp__glMatrixMode@4
1>MGLApp.obj : error LNK2019: unresolved external symbol __imp__glViewport@16 referenced in function "public: void __thiscall MGLApp::SetupProjection(int,int)" (?SetupProjection@MGLApp@@QAEXHH@Z)
1>MGLApp.obj : error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function "public: void __thiscall MGLApp::Update(double)" (?Update@MGLApp@@QAEXN@Z)
1>MGLWin32.obj : error LNK2019: unresolved external symbol __imp__wglDeleteContext@4 referenced in function "long __stdcall MainWindowProc(struct HWND__ *,unsigned int,unsigned int,long)" (?MainWindowProc@@YGJPAUHWND__@@IIJ@Z)
1>MGLWin32.obj : error LNK2019: unresolved external symbol __imp__wglMakeCurrent@8 referenced in function "long __stdcall MainWindowProc(struct HWND__ *,unsigned int,unsigned int,long)" (?MainWindowProc@@YGJPAUHWND__@@IIJ@Z)
1>MGLWin32.obj : error LNK2019: unresolved external symbol __imp__wglCreateContext@4 referenced in function "long __stdcall MainWindowProc(struct HWND__ *,unsigned int,unsigned int,long)" (?MainWindowProc@@YGJPAUHWND__@@IIJ@Z)
1>glee.lib(GLee.obj) : error LNK2019: unresolved external symbol __imp__wglGetProcAddress@4 referenced in function ___GLeeGetProcAddress
1>glee.lib(GLee.obj) : error LNK2019: unresolved external symbol __imp__wglGetCurrentDC@0 referenced in function ___GLeeGetExtStrPlat
1>glee.lib(GLee.obj) : error LNK2019: unresolved external symbol __imp__glGetString@4 referenced in function ___GLeeGetExtensions
1>.\Debug/HeightmapDemo.exe : fatal error LNK1120: 26 unresolved externals
It looks like you need glee.lib

This is how I have vs setup:
description of your image
Thanks! That worked finally. Looks like I need the 3 additional libraries.

This topic is closed to new replies.

Advertisement