[转]unresolved external symbol _*

unresolved external symbol _* (转载)

texture.obj : error LNK2001: unresolved external symbol __imp__glEnable@4
texture.obj : error LNK2001: unresolved external symbol __imp__glTexEnvf@12
texture.obj : error LNK2001: unresolved external symbol __imp__glTexParameterf@12
texture.obj : error LNK2001: unresolved external symbol __imp__glTexImage2D@36
texture.obj : error LNK2001: unresolved external symbol __imp__glPixelStorei@8
texture.obj : error LNK2001: unresolved external symbol _auxDIBImageLoadA@4

解决方法:
1. 先弄清楚到底缺了哪些库,再在project-setting-link里面的moldul/lib 添加这些库的文件。
2. 可以用以下形式在源程序里面添加下面代码:
#pragma comment(lib, "openGL32.lib")
#pragma comment(lib, "glu32.lib")
#pragma comment(lib, "glaux.lib")

#pragma comment( lib,"openGL32.lib" ) 这句的意思是将openGL32.lib库加入到工程中进行编译。

你可能感兴趣的:([转]unresolved external symbol _*)