OpenGL链接时:unresolved external symbol _glFlsuh

来源:百度知道 编辑:UC知道 时间:2024/06/08 17:53:42
#include <GL/glut.h>

void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POLYGON);
glVertex2f(-0.5,-0.5);
glVertex2f(-0.5,0.5);
glVertex2f(0.5,0.5);
glVertex2f(0.5,-0.5);
glEnd();
glFlsuh();
}

int main(int argc, char**argv)
{
glutInit(&argc,argv);
glutCreateWindow("Simple");
glutDisplayFunc(display);
glutMainLoop();
}

编译的时候只有警告:
Compiling...
Simple.c
F:\VC程序练习\Simple\Simple.c(12) : warning C4013: 'glFlsuh' undefined; assuming extern returning int
F:\VC程序练习\Simple\Simple.c(19) : warning C4113: 'void (__cdecl *)()' differs in parameter lists from 'void (__cdecl *)(void )'

Simple.obj - 0 error(s), 2 warning(s)

链接的时候出现下面的错误:
Linking...
Simple.obj : error LNK2001: unresolved external symbol _glFlsuh
Debug/Simple.exe : f

连接出错多半是你环境没搭建好的缘故,你的OpenGL编程环境搞好了吗,比如往system32下加glut.dll。
那VC平台的project/project setting里面的选项设置了吗