locked
fatal error C1083: Cannot open include file: 'gl/glut.h': No such file or directory

    Question

  • Before you ask , yes i already have search the forum, heck i even search yahoo for an asnwer. Very new to V C++ Express still, and i have the Platform SDK installed. I've seen the video, modified the proper files for VC++ Express.

    Im currently writing a small/simple win 32 console app, using the glut library. I download GLUT, put it into the proper location:

    glut into D:\Program Files\Microsoft Platform SDK\include\gl
    glut32.lib into D:\Program Files\Microsoft Platform SDK\Lib
    glut32.dll into C:\WINDOWS\system32

    /*beginning of my code
    #include <gl/glut.h>

    const GLsizei windowWidth = 500;
    const GLsizei windowHeight = 500; */


    I have $FrameworkSDKDir(without the $ sign of course) variable set to D:\Program Files\Microsoft Platform SDK in my System variables.

    I also have $VSInstallDir variable set to D:\Program Files\Microsoft Visual Studio 8 again in my System variable.

    Specially, i have my include path set to: $(FrameworkSDKDir)\include\gl in my VC++ directories

    With all that said and done..when i compile i get the following error:

    fatal error C1083: Cannot open include file: 'gl/glut.h': No such file or directory

    PS i even added glut32.lib to my linker input option.

    So whats going on?
    Wednesday, July 05, 2006 5:49 AM

Answers

  •  SonK wrote:

    /*beginning of my code
    #include <gl/glut.h>

    [... ]


    Specially, i have my include path set to: $(FrameworkSDKDir)\include\gl in my VC++ directories

    With all that said and done..when i compile i get the following error:

    fatal error C1083: Cannot open include file: 'gl/glut.h': No such file or directory

    1. Try using <glut.h> without the "gl/". 

    See if that gets you past the error message.  If not, make the following change also.

    2. In addition, try adding the following to your VC++ Include Path:

    $(Program Files)\actual-name-of-platformSDK-directory\include\gl

    or if you didn't install the PSDK in its default location, use the full path name that you did use (no $ variables).  I don't believe $(FrameworkSDKDir) is intended to apply to the Platform SDK.

    3. I am concerned that your configuration may have been destabilized by the mingling of other material in the PSDK directories (VC++ can find it anywhere you tell it), and that you will also have problems finding the libraries after you get past the problem with the headers.  (You'll also have to eventually deal with the fact that each PSDK update installs in a different location.)  Let's get past the current problem.  Once you are satisfied that you've got everything working, you can consider whether it is worthwhile to do a clean re-install and organize the files differently.

     - Dennis

    Wednesday, July 05, 2006 3:53 PM
  •  SonK wrote:
    step 1 to 6 done. It should give me a clean system, but to my suprised i saw the same path setup in the VC++ directories(scary...).  This time i just use the default C drive for the install.

    VS80COMNTOOLS is set up as part of the install.  Other environment variables are setup and removed on an as-needed basis.  Don't worry about that just now.  You do not need to intervene on what VC++ does in this regard.

    You're doing fine. 

    I don't understand how you saw VC++ directories in step 6.  VC++ should not have been installed until step 7.  Did you uninstall it using Windows Add/Remove Programs in step 1?

    Here's what you should see in your VC++ Directories panes:

    Under Executable Files:

    $(VCInstallDir)bin
    $(VCInstallDir)PlatformSDK\bin
     ... [bunch more] ...
    $(Path)

    Under Include Files:

    $(VCInstallDir)include
    $(VCInstallDir)PlatformSDK\include
    $(FrameWorkSDKDir)include

    Under Library Files:

    $(VCInstallDir)lib
    $(VCInstallDir)PlatformSDK\lib

    ... [3 others] ...
    $(VSInstallDir)lib

    This is a generic setup and not all of the directories actually exist.  Don't worry about that.  Just leave this setup alone.

    Please confirm that this is what you have (with none of the PSDK installation instructions carried out yet).

     - Dennis

     

     

  • Thursday, July 06, 2006 5:01 PM

    All replies

    •  SonK wrote:

      /*beginning of my code
      #include <gl/glut.h>

      [... ]


      Specially, i have my include path set to: $(FrameworkSDKDir)\include\gl in my VC++ directories

      With all that said and done..when i compile i get the following error:

      fatal error C1083: Cannot open include file: 'gl/glut.h': No such file or directory

      1. Try using <glut.h> without the "gl/". 

      See if that gets you past the error message.  If not, make the following change also.

      2. In addition, try adding the following to your VC++ Include Path:

      $(Program Files)\actual-name-of-platformSDK-directory\include\gl

      or if you didn't install the PSDK in its default location, use the full path name that you did use (no $ variables).  I don't believe $(FrameworkSDKDir) is intended to apply to the Platform SDK.

      3. I am concerned that your configuration may have been destabilized by the mingling of other material in the PSDK directories (VC++ can find it anywhere you tell it), and that you will also have problems finding the libraries after you get past the problem with the headers.  (You'll also have to eventually deal with the fact that each PSDK update installs in a different location.)  Let's get past the current problem.  Once you are satisfied that you've got everything working, you can consider whether it is worthwhile to do a clean re-install and organize the files differently.

       - Dennis

      Wednesday, July 05, 2006 3:53 PM
  • Thanks for taking the time to help me out.

    !. I've tried it just now, same error.

    2. You mean something like this: "$(Program Files)\Microsoft Platform SDK\include\gl"? tried it also, doesnt work. I even just use a full path name without any variable like this: D:\Program Files\Microsoft Platform SDK\include\gl (normally this should work, but its not working anymore....argh).

    and it still doesnt see my glut.h header file. I was using CodeBlock IDE for awhile but following a MS Visual C++ 2003 tutorial with it would be painful, since i'm new to C++ programming, Never had this problem before until recently. It bad to the point that i cant do a simple program like this:


    [code]
    #include<iostream>

    using namespace std;

    int main()
    {
        cout << "This is killing me!!"<< endl;
    return 0;
    }
    [/code]

    fatal error LNK1104: cannot open file 'kernel32.lib'

    3. At this point a clean re-install would be welcome, but how does one do a "clean-reinstall" i was reinstalling VC++ Express 3 times yesterday, it still had all my default paths in the "C++ directories" so maybe that info is stored somewhere else on computer and the during uninstall it doesnt delete it? Anyway, can you walk me thru a "clean re-install"?


    Wednesday, July 05, 2006 8:06 PM
  •  SonK wrote:

    3. At this point a clean re-install would be welcome, but how does one do a "clean-reinstall" i was reinstalling VC++ Express 3 times yesterday, it still had all my default paths in the "C++ directories" so maybe that info is stored somewhere else on computer and the during uninstall it doesnt delete it? Anyway, can you walk me thru a "clean re-install"?

    The first step of a clean re-install is to uninstall everything so there is no remnant of the older materials on your system.

    1. Uninstall Visual C++ 2005 Express Edition using Add / Remove Programs.

    2. Uninstall the Windows Platform SDK.

    3. If you have set any default environment variables in your configuration that apply specifically to VC++ and the PSDK, delete those too.

    4. Make sure you have the gl files someplace where you can re-install them.

    5. In the $(Program Files) location on your machine, delete any of the folders that remain: Mcrosoft Visual Studio 8 and Microsoft Platform SDK ... .

    6. Save any code that you want to preserve from existing VC++ Express Edition projects.  Then delete your My Documents\Visual Studio 2005 directory.

    That should get you a clean system.

    7. First, reinstall Visual C++ 2005 Express Edition without attempting to add the PSDK or anything else (SQL Server Express Edition and the MSDN libraries are fine.  The MSDN libraries are indispensible.)  Allow default directory choices if you can.

    8. Confirm that you can create simple projects using VC++ File | New | Project ... with the Visual C++ | General project type and Empty Project template.   (I usually don't check "Create directory for solution.")  You can do all of the ANSI/ISO C/C++ simple applications that you want to make sure that the compiler and IDE are working properly.

    When you get to this point, and you are satisfied that you can build non-Windows native applications, let's talk about the Platform SDK.  I'd like to know which one you are using.  The latest one is the one that installs to "$(Program Files)\Microsoft Platform SDK for Windows Server 2003 R2" and the latest instructions apply to that.  Make sure you have that one. 

    When you are ready to install and integrate the PSDK with Visual C++ Express Edition, say so.   I want to be sure that you are using the proper integration instructions.

    After that, we can look at adding the gl libraries in a way that keeps it as simple as possible.

     - Dennis 

    Wednesday, July 05, 2006 10:11 PM
  • step 1 to 6 done. It should give me a clean system, but to my suprised i saw the same path setup in the VC++ directories(scary...).  This time i just use the default C drive for the install.

    And of course, with my luck it doesnt work. I compile a simple win32 console app, couting some basic messege.Im getting this error messege now:

    fatal error LNK1181: cannot open input file 'kernel32.lib'


    IMO my variable path in the VC++ directories are screw up, plus maybe the fact that my Environment Variables arent setup properly(or missing). After the install i check, and  VC++ setup one environment variable only:

    variable name:  VS80COMNTOOLS
    variable value:  C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\

    Theres no other variable that remotely looks like VC++ related, not even a PATH variable.

    So i guess what i need help on is, what variables to use in VC++ directories and also the environment variable(i assume im missing some). 


    Thursday, July 06, 2006 8:57 AM
  •  SonK wrote:
    step 1 to 6 done. It should give me a clean system, but to my suprised i saw the same path setup in the VC++ directories(scary...).  This time i just use the default C drive for the install.

    VS80COMNTOOLS is set up as part of the install.  Other environment variables are setup and removed on an as-needed basis.  Don't worry about that just now.  You do not need to intervene on what VC++ does in this regard.

    You're doing fine. 

    I don't understand how you saw VC++ directories in step 6.  VC++ should not have been installed until step 7.  Did you uninstall it using Windows Add/Remove Programs in step 1?

    Here's what you should see in your VC++ Directories panes:

    Under Executable Files:

    $(VCInstallDir)bin
    $(VCInstallDir)PlatformSDK\bin
     ... [bunch more] ...
    $(Path)

    Under Include Files:

    $(VCInstallDir)include
    $(VCInstallDir)PlatformSDK\include
    $(FrameWorkSDKDir)include

    Under Library Files:

    $(VCInstallDir)lib
    $(VCInstallDir)PlatformSDK\lib

    ... [3 others] ...
    $(VSInstallDir)lib

    This is a generic setup and not all of the directories actually exist.  Don't worry about that.  Just leave this setup alone.

    Please confirm that this is what you have (with none of the PSDK installation instructions carried out yet).

     - Dennis

     

     

  • Thursday, July 06, 2006 5:01 PM
  • yes, i have done step 1 to 7, on 7 step i reinstalled VS C++ Express(the IDE) and i didnt the PSDK yet.


    and yes i did remove the both the PSDK and VS C++ Express with Widnows Add/Remove program.


    seem i have most of those VC++ directories for the include/Exe/Lib. what i dont have is any variable related to Express in the Environment Variables for my system...(expect for the one i already mention).
    Thursday, July 06, 2006 10:03 PM
  •  SonK wrote:
    seem i have most of those VC++ directories for the include/Exe/Lib. what i dont have is any variable related to Express in the Environment Variables for my system...(expect for the one i already mention).

    You are looking for variables that do not exist.  The installation of VC++ 2005 Express Edition defines only the one environment variable that you have alread noticed.  There are none missing.

    Let's divide the problem here.  I'll show you how and when environment variables are defined.

    1. VC++ Directories.  First, confirm that the lists of directories that I showed you are the lists that you have (with some from the middle of longer lists not shown).  We need to be sure of that so that we can determine why your VC++ Project does not compile.

    2. Command-Line Environment Setup.  Now, for using the VC++ command-line compiler and other tools from a console session, you will need more environment variables.  But only if you are doing it that way.  Here is a way to have the variables all defined and ready to go.

    2.1 In Visual C++ 2005 Express Edition, select Tools | Visual Studio 2005 Command Prompt

    2.2 Notice that the first command executed in the console session that opens up is a .bat file at a particular location.  Hold that thought.

    2.3 Perform the console command

    set | more

    2.4 You should see a bunch of definitions that are not present when you simply open the Command Prompt in Windows.  On my configuration, there are

    DevEnvDir=C:\Program Files\Microsoft Visual Studio 8\Common7\IDE
    FrameworkDir=C:\WINDOWS\Microsoft.NET\Framework
    FrameworkSDKDir=C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0
    FrameworkVersion=v2.0.50727
    INCLUDE=C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE;
    LIB=C:\Program Files\Microsoft Visual Studio 8\VC\LIB;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\lib;
    LIBPATH=C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
    Path=C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;C:\Program Files\Microsoft Visual Studio 8\VC\BIN;C:\Program Files\Microsoft Visual Studio 8\Common7\Tools;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program Files\Microsoft Visual Studio 8\VC\VCPackages;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\Program Files\Microsoft SQL Server\90\Tools\binn\
    VCINSTALLDIR=C:\Program Files\Microsoft Visual Studio 8\VC
    VSINSTALLDIR=C:\Program Files\Microsoft Visual Studio 8
    WecVersionForRosebud.420=2

    2.5 Those definitions are all you need to build standard C/C++ console (non-Windows) applications using the command-line compiler.  Because the VC++ Tools | Visual Studio 2005 Command Prompt puts you in an awkward place, I find it valuable to create my own "command-prompt" shortcuts that put me in the Projects directory but run the environment definition batch file vcvars.bat as part of their startup. 

    2.6 When you install the Platform SDK, there are additional batch files that are installed that you can use for command-line operation.  The general approach is to run the VC++ one, followed by the appropriate PSDK one.

    2.7 You will also need to set compiler options yourself.  For a simple C++ compilation, you will simply need a command line like this:

    C:\MyProjects\Hello> cl /EHsc hello.cpp

    3. So were your errors as part of command-line compiles, or do we need to continue to find out why your simple C++ program couldn't compile for lack of kernel32.lib ?

     - Dennis

  • Thursday, July 06, 2006 11:46 PM
  • It's a basic issue.....!!

    The two paths for the files are incorrect for Visual Studio Express edition....!!


    glut into D:\Program Files\Microsoft Platform SDK\include\gl          ( incorrect )
    glut32.lib into D:\Program Files\Microsoft Platform SDK\Lib           ( incorrect )


    glut.h        into    C:\Program Files\Microsoft Visual Studio 9.0\VC\include         
    glut32.lib   into   C:\Program Files\Microsoft Visual Studio 9.0\VC\lib


    Now  change #include <gl/glut.h>  into  #include<glut.h>

    and It should work fine!!

    or you can create a Folder (GL) and place the glut.h file in that folder.....!!!
    PEACE!.............


    Wednesday, November 25, 2009 8:44 PM
  • hi thx man i had the same problem and i managed to solve it by removing gl/ so i just wanted to thank you god bless u
    Tuesday, October 12, 2010 8:08 PM