Including <Agl/agl.h> ...

  • I created a Cocoa application using the Xcode wizard and wanted to try
    some example from the OpenGL SuperBible and keep getting no such file
    or directory errors with the agl.h header.

    I come from the C++ world and I am quite confused how this is supposed
    to work.  I found the agl.h header file at:

    /System/Library/Frameworks/AGL.framework/Versions/A/Headers

    Typically I am used to seeing the real file path match the header
    path.  Is it different in Cocoa?  I was expecting to find agl.h in a
    directory called /.../Agl/

    Thanks,
    graham

    #import <Cocoa/Cocoa.h>
    #include <Agl/agl.h>

    int main(int argc, char *argv[])
    {
        return NSApplicationMain(argc,  (const char **) argv);
    }
  • On Nov 17, 2007, at 11:16 PM, Graham Reitz wrote:

    > I created a Cocoa application using the Xcode wizard and wanted to
    > try some example from the OpenGL SuperBible and keep getting no such
    > file or directory errors with the agl.h header.
    >
    > I come from the C++ world and I am quite confused how this is
    > supposed to work.  I found the agl.h header file at:
    >
    > /System/Library/Frameworks/AGL.framework/Versions/A/Headers
    >
    > Typically I am used to seeing the real file path match the header
    > path.  Is it different in Cocoa?  I was expecting to find agl.h in a
    > directory called /.../Agl/

    This isn't a Cocoa thing, this is a Mac OS X thing called frameworks.

    <http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/Con
    cepts/WhatAreFrameworks.html
    >

    ...and about how to include them...

    <http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/Tas
    ks/IncludingFrameworks.html
    >

    -Shawn
  • Thanks Shawn,

    I was almost there.  All of the examples include AGL this way:

    #include <Agl/agl.h>

    After reading those links.  (Thanks again for your help, I am on the
    steep slope of the learning curve for mac development.)
    It says:

    #include <Framework_name/Header_filename.h>
    #import <Framework_name/Header_filename.h>

    The AGL framework is named AGL and not Agl, case matters.  I'll let
    the author of the examples know.

    Kindly,

    Graham

    On Nov 18, 2007, at 10:32 AM, Shawn Erickson wrote:

    >
    > On Nov 17, 2007, at 11:16 PM, Graham Reitz wrote:
    >
    >> I created a Cocoa application using the Xcode wizard and wanted to
    >> try some example from the OpenGL SuperBible and keep getting no
    >> such file or directory errors with the agl.h header.
    >>
    >> I come from the C++ world and I am quite confused how this is
    >> supposed to work.  I found the agl.h header file at:
    >>
    >> /System/Library/Frameworks/AGL.framework/Versions/A/Headers
    >>
    >> Typically I am used to seeing the real file path match the header
    >> path.  Is it different in Cocoa?  I was expecting to find agl.h in
    >> a directory called /.../Agl/
    >
    > This isn't a Cocoa thing, this is a Mac OS X thing called frameworks.
    >
    > <http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/Con
    cepts/WhatAreFrameworks.html
    > >
    > >
    >
    > -Shawn
  • On Nov 18, 2007 4:53 PM, Graham Reitz <grahamreitz...> wrote:
    > Thanks Shawn,
    >
    > I was almost there.  All of the examples include AGL this way:
    >
    > #include <Agl/agl.h>

    I believe AGL is deprecated as of Leopard anyway. You might want to
    use GLUT, or if you're a Cocoa application NSOpenGLView etc.

    -- Finlay
previous month november 2007 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today