在 Visual Studio 项目目录中找不到头文件
Cannot find header file in Visual Studio project directory
我正在尝试使用 Visual C++ 构建一个简单的 Windows 32 控制台应用程序乒乓游戏。有关详细信息,请参阅 link 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
?
查看第 Team Development with Visual Studio .NET and Visual SourceSafe 页。它也可能有助于解决未来的问题。从您正在使用的软件的开发者那里寻找答案总是好的。
我正在尝试使用 Visual C++ 构建一个简单的 Windows 32 控制台应用程序乒乓游戏。有关详细信息,请参阅 link 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
?
查看第 Team Development with Visual Studio .NET and Visual SourceSafe 页。它也可能有助于解决未来的问题。从您正在使用的软件的开发者那里寻找答案总是好的。