OpenGL programming error analysis


C :\ Program Files (x86)\ Microsoft Visual Studio 11.0\ VC \ Include \ GL \glew.h 84 1 consoleApplication8
Solution:
#if defined(__gl_h_) || defined(__GL_H__) || defined(__X_GL_H)
#error gl.h included before glew.h

#include <GL/glew.h>
#include <GL/glut.h>

Glew.h is written in front of GLUT.

error
1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol __imp__glewInit@0, which is found in the function “void __cdecl init(void)” (?
1> init @@yaxxz)
1>; ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol __imp__glewGetErrorString@4, which is found in the function “void __cdecl init(void)” (?
1> init @@yaxxz)
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewBindBuffer
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____ glewbufferData
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewGenBuffers
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewAttachShader
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____ glewcompileShader
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewCreateProgram
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewCreateShader
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewDeleteShader
1>; ConsoleApplication8. Obj: error LNK2001: cannot resolve the external symbol of __imp____glewEnableVertexAttribArray
1 & gt; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewGetProgramInfoLog
; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewGetProgramiv
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____ glewgetShaderInfolog
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewGetShaderiv
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewLinkProgram
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewShaderSource
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewUseProgram
1>; ConsoleApplication8.obj: error LNK2001: Unable to parse external symbol __imp____ glewvertexattribute
; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____ glewbindVertexArray
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____ glewGenvertexArrays
Solution:

#pragma comment(lib,"glew32.lib")

Error:

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutInit@8, which is referenced in function _main

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutInitDisplayMode@4, which is referenced in function _main

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutInitWindowPosition@8, which is referenced in function _main

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutInitWindowSize@8, which is referenced in function _main

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutMainLoop@0, which is referenced in function _main

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutCreateWindow@4, which is referenced in function _main

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutSwapBuffers@0, which is displayed in the function “void __cdecl display(void)” (?Display @@yaxxz)

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutDisplayFunc@4, which is referenced in function _main

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutKeyboardFunc@4, which is referenced in function _main

Solution:

#pragma comment(lib,"glut32.lib")

error:

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol __imp__glClear@4, which is displayed in the function “void __cdecl display(void)” (?Display @@yaxxz) is referenced in
1> init @@yaxxz)
1>; ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol __imp__glDrawArrays@12, which is displayed in the function “void __cdecl display(void)” (?Display @@yaxxz) is referenced in
1>; ConsoleApplication8.obj: error LNK2019: Unable to resolve external symbol __imp__glGetString@4, which is used in the function “void __cdecl initShader(char const *,char const *)” (?InitShader@@YAXPBD0@Z) is referenced
Solution:

#pragma comment(lib,"OpenGL32.lib")

Read More: