1

我想使用GLUT來簡化我的代碼和工作。OpenGL和VS2010無法解析的外部

我使用Windows 7(64位)和Visual Studio 2010中我所做的一切就像在this tutorial,仍然無法編譯我的代碼...我得到這些錯誤:

Error 2 error LNK1120: 1 unresolved externals <path> 
Error 1 error LNK2019: unresolved external symbol [email protected] referenced in function ___tmainCRTStartuL 

代碼我用:

#include <GL/glew.h> 
#include <GL/glut.h> 

void display (void) { 
    glClearColor(1.0f, 0.0f, 0.0f, 1.0f); 
    glClear(GL_COLOR_BUFFER_BIT); 
    glLoadIdentity(); 

    glFlush(); 
} 

int main (int argc, char **argv) { 
    glutInit(&argc, argv); 
    glutInitDisplayMode (GLUT_SINGLE); 
    glutInitWindowSize (500, 500); 
    glutInitWindowPosition (100, 100); 
    glutCreateWindow ("Your first OpenGL Window"); 

    glutDisplayFunc(display);/

    glutMainLoop(); 
} 

有人知道最新的問題以及如何解決它嗎?

回答

1

似乎是你創建的Windows應用程序而不是控制檯一。 以下說明如何改變PIC /選擇Windows子系統

enter image description here

+0

感謝的人!這有幫助!愛你的:)),但是現在,當我運行程序的窗口顯示了在後臺控制檯窗口...我可以以某種方式修改它的控制檯將不apear? – L3M0L 2013-03-15 21:04:22

+0

嘗試將其插入到main()前導符HWND hWnd = :: GetConsoleWindow(); ::的ShowWindow(HWND,SW_HIDE); – 2013-03-15 21:09:07

+0

Jupp,工作!再次感謝! :) – L3M0L 2013-03-15 21:14:28