locked
C++ Missing Directives Compilation RRS feed

  • Question

  • Using Visual Studio 2017, compiling a C++ program that was developed in Microsoft Visual C++ 6.0, now implementing under Win 10. When I try to compile the program, getting output errors, cannot find the directive libraries:

    #include <windows.h>

    #include <gl\gl.h>

    #include <gl\glu.h>

    #include <gl\glaux.h>

    #include <stdio.h>

    @include <math.h>

    Am using Opengl calls, that's why I need the GL Library routines. Not familiar with Virtual Studio 2017 so does it differ from Microsoft Visual C++6.0 and do I need to specify extensions or? Please advise, Sid Kraft

    Wednesday, June 6, 2018 4:51 PM

All replies

  • Your message is a bit confusing.  There's no such thing as "directive libraries".  Are you saying it cannot find the include files?  Is it missing ALL of the include files, or only the OpenGL include files?  If it is missing all of the include files, then there must have been a problem installing Visual Studio.

    The OpenGL files are part of the Windows SDK, not part of Visual Studio.  Have you installed the Windows SDK?

    glaux was a wrapper library that Microsoft created.  It's not part of OpenGL, and it's not included any more.  If you need routines from there, there are places on the Internet where you can download the include file, but you might consider whether there are standard OpenGL methods of accomplishing your task.

    By the way, traditionally one uses only forward slashes in #include directives.  That way, your code stands a chance of working on other non-Microsoft systems.


    Tim Roberts, Driver MVP Providenza & Boekelheide, Inc.

    Wednesday, June 6, 2018 6:15 PM
  • Using Visual Studio 2017, compiling a C++ program that was developed in Microsoft Visual C++ 6.0, now implementing under Win 10. When I try to compile the program, getting output errors, cannot find the directive libraries:

    Always show the exact text of the error message.
    Wednesday, June 6, 2018 6:33 PM
  • Go to the project properties. In Configuration Properties click on "VC++ Directories". Click in the Include Directories and then the down-arrow and then select Edit. In the Evaluated Values you will see a directory such as:

    C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\ucrt

    The important part is the "C:\Program Files (x86)\Windows Kits\10\Include". That directory has subdirectories for each SDK version installed in your system.

    Next go to the General node of the Configuration Properties. There is a "Windows SDK Version" there. Change it to whatever version you want to that there is a SDK version in your system for.

    Also, look at the "um" subdirectory of the directory for the version you chose. There should be a "gl" subdirectory that corresponds to the "gl\glu.h" you are including. As Tim Roberts explains, there is not a glaux.h there, right? OpenGL is not a Microsoft product so if you need help with it then you are more likely to get help in a non-Microsoft forum.

    I apologize for not researching this for your previous question, I almost had it figured out. At least now you will get the best answer here if there is anything more to this.



    Sam Hobbs
    SimpleSamples.Info


    • Edited by Simple Samples Wednesday, June 6, 2018 6:37 PM clarification and spelling
    • Proposed as answer by Baron Bi Thursday, June 7, 2018 1:36 AM
    Wednesday, June 6, 2018 6:35 PM
  • Thanks for the info, will try, Sid Kraft
    Wednesday, June 6, 2018 9:48 PM
  • Tim Downloaded Windows SDK, still getting the missing Directive errors, will remove and re-instated the Visual Studio 2017 system, try again. You said that using / instead of < or > is more applicable, like this: #include /windows.h/ ? let me know Sid
    Thursday, June 7, 2018 7:13 PM
  • He means use:

    #include <gl/gl.h>
    #include <gl/glu.h>
    

    Instead of:

    #include <gl\gl.h>
    #include <gl\glu.h>

    It makes no difference for Windows but the forward slash is more likely to work with other compilers or OSs.



    Sam Hobbs
    SimpleSamples.Info

    Thursday, June 7, 2018 7:38 PM