Results 1 to 5 of 5

Thread: Open GL in Visual C++

  1. #1

    Open GL in Visual C++

    I can't seem to get Open GL to work in VC++ 5.0. When I compile a program that includes gl/gl.h, it generates 102 errors! Ack! Any ideas?

  2. #2
    Junior Member Newbie
    Join Date
    Sep 2001

    Re: Open GL in Visual C++

    Are you sure that the gl.h library is in the right spot? It is a pain to configure.

  3. #3

    Re: Open GL in Visual C++

    Yeah, its in the right spot. Here's what its giving me in the little build window thingymajig:

    --------------------Configuration: Cpp1 - Win32 Debug--------------------
    E:\Programming\Devstudio\VC\INCLUDE\gl\gl.h(1135) : error C2501: 'WINGDIAPI' : missing decl-specifiers
    E:\Programming\Devstudio\VC\INCLUDE\gl\gl.h(1135) : error C2239: unexpected token 'type' following declaration of 'WINGDIAPI'
    E:\Programming\Devstudio\VC\INCLUDE\gl\gl.h(1135) : error C2062: type 'void' unexpected
    E:\Programming\Devstudio\VC\INCLUDE\gl\gl.h(1136) : error C2501: 'WINGDIAPI' : missing decl-specifiers


    E:\Programming\Devstudio\VC\INCLUDE\gl\gl.h(1160) : fatal error C1003: error count exceeds 100; stopping compilation
    Error executing cl.exe.

    Cpp1.exe - 102 error(s), 0 warning(s)

    The program code is as follows:

    #include <gl\gl.h>

    int main()
    return 0;

    And in the project->settings window, on the link tab, I have:

    glu32.lib glaux.lib opengl32.lib glut32.lib


  4. #4
    Member Contributor
    Join Date
    Jun 2001

    Re: Open GL in Visual C++

    try this:
    #include <windows.h>
    #include <GL/gl.h>

    on m$-systems u have to include windows.h before u can include gl.h, because of some structs used in the gl.h, but defined in windows.h

  5. #5

    Re: Open GL in Visual C++

    It worked! Thanks a LOT! That is the last thing I would've thought of... That is kinda stupid that windows.h MUST be included... Oh well, thanks a LOT!

    Thanks thanks.

Similar Threads

  1. Visual C++ Open GL Installation
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-26-2004, 10:09 AM
  2. how to make use of Open GL API in visual C++ 6
    By cryptic_developer in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-25-2002, 02:48 AM
  3. how to set visual c++ to use open gl?
    By vhylynx in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 02-25-2002, 06:35 AM
  4. Open gl and visual basic 6.0
    By gregio in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 02-27-2001, 05:33 PM
  5. Open GL using Visual C++ 6
    By gharval in forum OpenGL: Basic Coding
    Replies: 10
    Last Post: 11-24-2000, 03:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean