Solution to the problem that OpenGL can’t find glew32.dll in vs2019

#define GLEW_STATIC
#define GLEW_STATIC
#define GLEW_STATIC
#define GLEW_STATIC
#define GLEW_STATIC
#include < GL/glew.h>
#include < GLFW/glfw3.h>
#include
# pragma comment (lib, “glew32. Lib”)
int main() {

glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);


// Open GLFW Window
GLFWwindow* window = glfwCreateWindow(800, 600, "My OpenGL Game", NULL, NULL);

if (window == NULL)
{
	printf("open window failed");
	glfwTerminate();
	return -1;
}

glfwMakeContextCurrent(window);

// Init GLEW
GLboolean glewExperimental = true;
if (glewInit() != GLEW_OK)
{
	printf("init GLEW failed");
	glfwTerminate();
	return -1;
}

glViewport(0, 0, 800, 600);

while (!glfwWindowShouldClose(window))
{
	glfwSwapBuffers(window);
	glfwPollEvents();
}

glfwTerminate();
return 0;

}
Glew32.dll

1

1

1

1

1

1

br>
> You need to enter the C disk with admin privileges, then put a copy of glew32.dll into C:\Windows\SysWOW64, the problem is fixed, the window appears


Read More: