Solve: error LNK2019: unresolved external symbol __imp__glClear

Long story short:

visual studio. Additional Dependencies, add a OpenGL32.lib, do not specify a directory.

Note that this is a 32-bit platform, 64 own look. 64 to try to change or do not change (I met there called windows sdks 32 is 64 OpenGL32.lib)

背景-What Really happened

Recently doing 2D game with SDL, SDL want to write about in the Shader, read the tutorial:

http://lazyfoo.net/tutorials/SDL/51_SDL_and_modern_opengl/index.php

It was found that error, similar

error LNK2019: unresolved external symbol __imp__glClear .....

Anyway, it is not the function of a bunch of GL link.

Baidu, Bing search There are glut of said equipment, which is to make bricks, dug a mountain.

bing search to the country, let me find OpenGL32.lib in program files (x86), the setting on. I thought this should be the correct answer, and found that the inner tube is called OpenGL32.lib system turned out to be a 64-bit! ! !

Then I found a bing International, found very vs sao, just add a OpenGL32.lib on the line, it should be looking for comes to go. Dx seems to have a similar operation? ...

Well ... Anyway, really disgusting.

Summary - (tm which you can summarize the truth?)

um, yes. Gl out before high school program when, in fact, encountered this problem. But then I thought too much, engage in a glut. Later met do not know what pit, then from

And nothing touched the native OpenGL library. This time to find the "right" answer, simply because

1. With the compiler - the concept of a link, defined the problem lies in the realization could not find GL functions, namely the lack of lib or dll.

I do not want to use glut. It can be said that the concept is very important; realistic, detailed exploration is very important.

2. The accumulated experience in graphics-related self-study and work. I can not clearly know the code in question. If I was in high school, possibly guess where the code is not the problem, farther side.

3. Skills reasonable search. High school or full Baidu. In the case not over the wall, bing international fine.

It can be considered to boast over (Shoop ~), the end.

 

Published 43 original articles · won praise 11 · views 30000 +

Guess you like

Origin blog.csdn.net/qq_41524721/article/details/104330656