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:
- Two problems in OpenGL Programming
- OpenGL basic graphics programming – OpenGL and 3D graphics world
- OpenGL Programming Guide 8th Edition 9th Edition vs2015 vs2017 configuration method
- OpenGL learning — problems encountered in compiling OpenGL program for the first time
- Errno in Linux Programming
- The 11th Zhejiang Provincial Collegiate Programming Contest
- Vs2017 installing OpenGL
- Deep understanding of async await asynchronous programming synchronization
- Analysis of compilation errors of “error conflicting types for function”
- A strange problem in compiling OpenGL program
- Solutions to some problems encountered in programming with vs2017
- C#: Analysis of the difference between write() and writeline()
- In vs programming, the code of Ctrl + F5 is flashback
- Analysis of “RSL error 1 of 1”
- Configuring OpenGL in Visual Studio 2015
- Mistakes in learning Flink programming
- Configuring OpenGL in VS
- Source code analysis of macOS startup process
- Online problem solving analysis
- Recipe for target’Project 1.exe’ failed Cause analysis and solution