OpenGL和VS2010外部未解决 [英] OpenGL and VS2010 unresolved external

查看:134
本文介绍了OpenGL和VS2010外部未解决的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用GLUT简化我的代码和工作.

I want to use GLUT to simplify my code and work.

我正在使用Windows 7(64位)和Visual Studio2010.我做了

I'm using windows 7 (64 bit) and Visual Studio 2010. I did everything like in this tutorial and still can't compile my code... I get these errors:

Error 2 error LNK1120: 1 unresolved externals <path>
Error   1   error LNK2019: unresolved external symbol _WinMain@16 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(); 
} 

有人知道问题出在哪里以及如何解决吗?

Does someone know whats the problem and how to fix it?

推荐答案

似乎是您创建的 Windows 应用程序而不是 Console 应用程序. 有关如何更改/选择Windows子系统的信息,请参见下面的图片

Seems that your created Windows application instead of a Console one. See the pic below for how to change/choose the Windows subsystem

这篇关于OpenGL和VS2010外部未解决的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆