Results 1 to 6 of 6

Thread: problem with my first program

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2003
    Posts
    2

    problem with my first program

    i brought an opengl learning book and after finishing the first chapter i decided to try out the small programs that were discussed there, im trying to do the first one(draw a single polygon in a window) but i keep getting this error

    Cannot open include file: 'glut.h': No such file or directory

    i downloaded the glut source code from here
    http://www.opengl.org/developers/doc...tion/glut.html and added it to my program but i keep getting the same error, anyone know why it would be doing that?thanks.




    [This message has been edited by eastypops (edited 07-11-2003).]

  2. #2
    Senior Member Regular Contributor
    Join Date
    Sep 2002
    Location
    Nanjing,China
    Posts
    116

    Re: problem with my first program

    Oh my , what IDE you are using , this is not OPENGL problem rather than IDE familarity.

    First of all, have a look into your IDE "include" and "lib" directory , get a idea how your ide directories organize , then you would know what to do first.

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: problem with my first program

    As the error states "No such file", which mean you don't have the required file to compile the program.

    You need to download the GLUT library for you compiler and install it. The glut source file that you downloaded has to be compiled into a library file before it can be used, better that you download a pre-compiled library for you compiler.


    Note when posted a compiling problem also tell us what operating system you are using and what compiler that you are using.

    If you tell us this information we can point you to the corrent version of the GLUT library for your system and compiler. And how to install it.


    Originally posted by eastypops:
    i brought an opengl learning book and after finishing the first chapter i decided to try out the small programs that were discussed there, im trying to do the first one(draw a single polygon in a window) but i keep getting this error

    Cannot open include file: 'glut.h': No such file or directory

    i downloaded the glut source code from here
    http://www.opengl.org/developers/doc...tion/glut.html and added it to my program but i keep getting the same error, anyone know why it would be doing that?thanks.


    [This message has been edited by eastypops (edited 07-11-2003).]


    [This message has been edited by nexusone (edited 07-12-2003).]

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Feb 2002
    Location
    Bonn, Germany
    Posts
    1,633

    Re: problem with my first program

    Your compiler maintains an include directory, there should be a subfolder gl.
    (that's why it's #include <gl/glut.h> )

    You need a glut.h and copy it into that folder. In MSVC6 this should be something like
    C:\Program Files\Microsoft Visual Studio\VC98\Include\gl\

    You can get a precompiled glut dll and the header from Nate Robins' site .

  5. #5
    Junior Member Newbie
    Join Date
    Jul 2003
    Posts
    2

    Re: problem with my first program

    k, i got it working thanks to the advice. i copied the files in glutsource\include\GL to Microsoft Visual Studio\VC98\Include\GL then i downloaded the precompiled .dll and .lib and stuck the lib in Microsoft Visual Studio\VC98\Lib and the .dll in my debug folder and it compiled fine(after fixing a few errors). just wondering is that what i was supposed to do. btw im using msvc 6.

  6. #6
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: problem with my first program

    I am not sure about using the .h from the glut source, but when you downloaded the pre-compiled library and dll files, there should have been also a glut.h file with them.

    Originally posted by eastypops:
    k, i got it working thanks to the advice. i copied the files in glutsource\include\GL to Microsoft Visual Studio\VC98\Include\GL then i downloaded the precompiled .dll and .lib and stuck the lib in Microsoft Visual Studio\VC98\Lib and the .dll in my debug folder and it compiled fine(after fixing a few errors). just wondering is that what i was supposed to do. btw im using msvc 6.

Similar Threads

  1. Replies: 1
    Last Post: 05-14-2014, 04:58 PM
  2. 2 Little problem in My Program..=/
    By Heavens in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 06-09-2011, 04:48 PM
  3. Problem with First Program
    By zrawson in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-01-2008, 11:59 PM
  4. what is the problem with my little program ?
    By airseb in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 06-25-2002, 05:48 AM
  5. I still have a problem with my program
    By airseb in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 06-24-2002, 04:08 PM

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