2

I installed "MS VS VC++ 2010 Express" for the first time after using Eclipse. I followed the instructions to install it at "Setting Up GLFW in Visual Studio 2010".

Then I wrote this program to test it, which worked fine in 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;
}

And this is what it says in the console:

------ 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 ==========

There might be a flaw in the installation process, if so, that what could be wrong?

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
SortOf
  • 459
  • 1
  • 5
  • 5
  • 1
    You need to configure VS to know where you installed glfw's headers. You'll also need to configure the location of the glfw library(ies). – Jerry Coffin Jun 12 '13 at 16:38
  • 1
    See the same question (and comments) here: http://stackoverflow.com/questions/17052938/cant-find-the-header-when-i-linka-lib-in-visual-studio-2012/17053027#17053027 – collaborator Jun 12 '13 at 16:45

1 Answers1

0

Those instructions are missing setting up your include path. You need to add the parent directory of the directory GL that contains all the include files for GLFW to either Project Properties/Configuration Properties/VC++ Directories/Include Directories or Project Properties/Configuration Properties/C/C++/General/Additional Include Directories.

davidbak
  • 5,775
  • 3
  • 34
  • 50