Error LNK2019 unresolved external symbol __imp__ChoosePixelFormat@8 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) Template
C:\Demo_Nehe\Lesson02\Lesson2.obj 1
- error LNK2019: unresolved external symbol
- Error 1 error LNK2019: unresolved external symbol __imp__glewInit@0
- Error 2 error LNK2019: unresolved external symbol __imp__glewGetErrorString@4
- Error 3 error LNK2001: unresolved external symbol __imp____glewAttachShader
- Error 4 error LNK2001: unresolved external symbol __imp____glewCompileShader
- Error 5 error LNK2001: unresolved external symbol __imp____glewCreateProgram
- Error 6 error LNK2001: unresolved external symbol __imp____glewCreateShader
- Error 7 error LNK2001: unresolved external symbol __imp____glewDeleteProgram
- Error 8 error LNK2001: unresolved external symbol __imp____glewDisableVertexAttribArray
- Error 9 error LNK2001: unresolved external symbol __imp____glewEnableVertexAttribArray
- Error 10 error LNK2001: unresolved external symbol __imp____glewGetAttribLocation
- Error 11 error LNK2001: unresolved external symbol __imp____glewGetProgramiv
- Error 12 error LNK2001: unresolved external symbol __imp____glewGetShaderiv
- Error 13 error LNK2001: unresolved external symbol __imp____glewLinkProgram
- Error 16 error LNK2001: unresolved external symbol __imp____glewVertexAttribPointer
- Error 17 error LNK1120: 16 unresolved externals
- C++ / OpenGL | “undefined reference to `_imp__ChoosePixelFormat@8`” and more
while i want to compile my opengl code i get the following errors:
I was reading NeHe's first guide to OpenGL programming, and when it came down to compiling the result of completing his first tutorial, I was stumped to find errors throughout. Here's the entire source file where the errors occur (Created in Eclipse CDT with 'opengl32' 'glaux' 'glut32' 'glu32' linked successfully):
the solution from post: Link against gdi32 (i.e. add -lgdi32 to the linker command line). This library defines the functions ChoosePixelFormat, SetPixelFormat and SwapBuffers which are reported as undefined references in the linker error messages.
My solution is: use freeglut lib file and header file.
This is a paragraph.
This is a paragraph.
This is a paragraph.
This is a paragraph.
This is a paragraph.
This is a paragraph.
This is a paragraph.
This is a paragraph.
This is a paragraph.
This is a paragraph.
This is a paragraph.
This is a paragraph.
This is a paragraph.
This is a paragraph.
This is a paragraph.
This is a paragraph.
No comments:
Post a Comment