Wednesday, March 3, 2021

Error LNK2019 unresolved external symbol __imp__ChoosePixelFormat@8 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)"

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

  1. error LNK2019: unresolved external symbol
  2. while i want to compile my opengl code i get the following errors:

    • 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

  3. C++ / OpenGL | “undefined reference to `_imp__ChoosePixelFormat@8`” and more
  4. 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.

  5. This is a paragraph.

  6. This is a paragraph.

  7. This is a paragraph.

  8. This is a paragraph.

  9. This is a paragraph.

  10. This is a paragraph.

  11. This is a paragraph.

  12. This is a paragraph.

  13. This is a paragraph.

  14. This is a paragraph.

  15. This is a paragraph.

  16. This is a paragraph.

  17. This is a paragraph.

  18. This is a paragraph.

  19. This is a paragraph.

  20. This is a paragraph.

No comments:

Post a Comment