我正在尝试使用Visual C ++构建一个简单的Windows 32控制台应用程序pong游戏。有关更多信息,请参见链接http://www.noobtuts.com/cpp/2d-pong-game。我已经在名为freeglut_files的文件夹中下载了一组头文件以及DLL文件和库。
结构:
/GL
/freeglut.h
/freeglut.lib
/freeglut_ext.h
/freeglut_std.h
/glut.h
/freeglut.dll
/freeglut.lib
在Visual Studio Community 2015中,我的项目结构如下所示:
/Pong
/External Dependencies
/Contains a number of files including GL.h and GLU.h (see below)
/Header Files
/stdafx.h
/targetver.h
/Resource Files
/Source Files
/freeglut.dll
/freeglut.h
/freeglut.lib
/freeglut_ext.h
/freeglut_std.h
/glut.h
/Pong.cpp (executable)
/stdafx.cpp
/ReadMe.txt
我将所有文件(包括GL目录)添加到了Visual Studio项目的源文件目录中。由于某种原因,Visual Studio会将某些头文件放在/External Dependencies
文件夹中,包括GL.h和GLU.h。但是,我的编译器似乎找不到freeglut.h。我尝试将其移至/Header Files
目录,但无法将其移至/External Dependencies
目录。这是我给Pong.cpp的代码
#include "stdafx.h"
#include <string>
#include <windows.h>
#include <iostream>
#include <conio.h>
#include <sstream>
#include <math.h>
#include <gl\GL.h>
#include <gl\GLU.h>
#include "freeglut.h"
#pragma comment (lib, "OpenGL32.lib")
int _tmain(int argc, char** argv)
{
return 0;
}
编译器不会编译包含freeglut.h的行。该文件应该在哪里?为什么不能将其添加到/External Dependencies
?
看一下使用Visual Studio .NET和Visual SourceSafe进行团队开发的页面。将来也可能会帮助解决问题。尝试从正在使用的软件的开发人员那里找到答案总是一件好事。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句