c++ - 在 Visual Studio 项目目录中找不到头文件

标签 c++ visual-c++ visual-studio-2015 directory-structure

我正在尝试使用 Visual C++ 构建一个简单的 Windows 32 控制台应用程序乒乓球游戏。参见链接 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 。它也可能有助于解决 future 的问题。尝试从您所用软件的开发者那里寻找答案总是好的。

关于c++ - 在 Visual Studio 项目目录中找不到头文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36230253/

相关文章:

c++ - 使用 C++ 在我的应用程序的菜单栏中创建一个 "Save Current Setting"功能

visual-c++ - 跨编译器访问 __m128 字段

c++ - 需要在c++中以周期性时间间隔调用函数

.net - 将dll注入(inject)exe文件

visual-c++ - Orbbec 和 OpenNi2 : DeviceOpen using default: no devices found

c# - Visual Studio 2015 的 Web 应用程序响应时间变慢

javascript - 在 IIS 上使用 HTML5/Javascript 项目和单独的 ASP.NET Web API 项目部署解决方案

c++ - 在 GitHub 上编译 TinyMT 时隐式声明的 ‘...’ 已弃用 [-Wdeprecated-copy]

C++:尝试在单个 for 循环中使用 getlline() 填充多个 vector 时, vector 下标超出范围

c++ - 动态生成声音