关于openGL
程序代码:
#include "stdafx.h" #include <gl\glut.h> void myDisplay(void) { glClear(GL_COLOR_BUFFER_BIT); glRectf(-0.5f, -0.5f, 0.5f, 0.5f); glFlush(); } int main(int argc, char *argv[]) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE); glutInitWindowPosition(100, 100); glutInitWindowSize(400, 400); glutCreateWindow("第一个OpenGL程序"); glutDisplayFunc(&myDisplay); glutMainLoop() ; return 0; }
这几个错误 1>Compiling...
1>exercise04.cpp
1>Linking...
1>exercise04.obj : error LNK2019: unresolved external symbol __imp____glutInitWithExit@12 referenced in function _glutInit_ATEXIT_HACK@8
1>exercise04.obj : error LNK2019: unresolved external symbol __imp____glutCreateWindowWithExit@8 referenced in function _glutCreateWindow_ATEXIT_HACK@4
1>C:\Users\cc\Documents\Visual Studio 2008\Projects\exercise04\Debug\exercise04.exe : fatal error LNK1120: 2 unresolved externals
1>Build log was saved at "file://c:\Users\cc\Documents\Visual Studio 2008\Projects\exercise04\exercise04\Debug\BuildLog.htm"
1>exercise04 - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========