【问题标题】:How to fix "fatal error C1083: Cannot open include file" using Visual Studio如何使用 Visual Studio 修复“致命错误 C1083:无法打开包含文件”
【发布时间】:2013-06-12 16:36:50
【问题描述】:

我在使用 Eclipse 后第一次安装了“MS VS VC++ 2010 Express”。我按照说明在“Setting Up GLFW in Visual Studio 2010”安装了它。

然后我编写了这个程序来测试它,它在 Eclipse 中运行良好:

#include <stdlib.h>
#include <GL/glfw.h>
using namespace std;



int wmain(){

    int running = GL_TRUE;


    if (!glfwInit()){
        exit (EXIT_FAILURE);
    }


    if (!glfwOpenWindow( 300,300 ,0,0,0,0,0,0, GLFW_WINDOW)){
        glfwTerminate();
        exit(EXIT_FAILURE);
    }


    while (running) {
        glClear( GL_COLOR_BUFFER_BIT );

        glfwSwapBuffers();

        running = !glfwGetKey (GLFW_KEY_ESC) && glfwGetWindowParam (GLFW_OPENED);
    }




    glfwTerminate();

    exit(EXIT_SUCCESS);



return 0;
}

这就是它在控制台中所说的:

------ Build started: Project: first1, Configuration: Debug Win32 ------
  first.cpp
c:\users\pc\documents\visual studio 2010\projects\first1\first1\first.cpp(2): fatal error C1083: Cannot open include file: 'GL/glfw.h': No such file or directory
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

安装过程中可能存在缺陷,如果是,那可能是什么问题?

【问题讨论】:

标签: c++ visual-c++


【解决方案1】:

没有这些说明来设置您的包含路径。您需要将包含 GLFW 的所有包含文件的目录GL 的父目录添加到Project Properties/Configuration Properties/VC++ Directories/Include DirectoriesProject Properties/Configuration Properties/C/C++/General/Additional Include Directories

【讨论】:

    猜你喜欢
    • 2011-02-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-17
    • 1970-01-01
    • 2016-10-23
    相关资源
    最近更新 更多