C++ “如何修复”;致命错误C1083:无法打开包含文件";使用VisualStudio

C++ “如何修复”;致命错误C1083:无法打开包含文件";使用VisualStudio,c++,visual-c++,C++,Visual C++,在使用Eclipse之后,我第一次安装了“MS VS VC++2010 Express”。我按照说明将其安装在“” 然后我编写了这个程序来测试它,它在Eclipse中运行良好: #include <stdlib.h> #include <GL/glfw.h> using namespace std; int wmain(){ int running = GL_TRUE; if (!glfwInit()){ exit (EXIT_

在使用Eclipse之后,我第一次安装了“MS VS VC++2010 Express”。我按照说明将其安装在“”

然后我编写了这个程序来测试它,它在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;
}

安装过程中可能存在缺陷,如果存在,会出现什么问题

设置包含路径时缺少这些说明。您需要将包含GLFW的所有包含文件的目录
GL
的父目录添加到
Project Properties/Configuration Properties/VC++目录/include目录
Project Properties/Configuration Properties/C/C++/General/Additional include目录
VS以了解您在何处安装了glfw的标头。您还需要配置glfw库的位置。请参见此处的相同问题(和注释):
------ 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 ==========