From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f65bb,a45afd8139e1bc73 X-Google-Attributes: gidf65bb,public X-Google-Thread: 103376,a45afd8139e1bc73 X-Google-Attributes: gid103376,public From: Redmond Urbino Subject: Re: GNAT and OPENGL in windows NT Date: 1997/12/03 Message-ID: <3485F74D.2D45@bigfoot.com>#1/1 X-Deja-AN: 295009069 References: <3484A903.3943@bigfoot.com> <6635al$cg5$1@cf01.edf.fr> Reply-To: redmond.urbino@bigfoot.com To: Pascal Obry Organization: Lockheed Martin Newsgroups: comp.lang.ada,comp.graphics.api.opengl Date: 1997-12-03T00:00:00+00:00 List-Id: Please help. I am trying to get a simple openg gl program to run using gnat on windows nt. I'm using gnat 3.10, the latest win32ada, vc++ 5.0, and nt 4.0 I tried adding the option to gnatmake -largs \vc\include\opengl32.lib \vc\include\glu32.lib \vc\lib\glaux.lib I get lots of linker warnings like: ld: r:\vc\lib\opengl32.lib(OPENGL32.dll): warning: ignoring duplicate section `.text' ld: r:\vc\lib\opengl32.lib(OPENGL32.dll): warning: ignoring duplicate section `.idata$5' ld: r:\vc\lib\opengl32.lib(OPENGL32.dll): warning: ignoring duplicate section `.text' ld: r:\vc\lib\opengl32.lib(OPENGL32.dll): warning: ignoring duplicate section `.idata$5' I get an executable, but it wont run and I get an error that it has not been initialized properly If I don't include those libraries, I get linker errors like: ./cube.o(.text+0xfb):cube.adb: undefined reference to `glFlush@0' ./cube.o(.text+0x196):cube.adb: undefined reference to `auxInitDisplayMode@4' Thanks in advance. -------------------------------------------------------------------------------------------------- -- -- Author : Pascal Obry -- -- This is a sample program to show some OpenGL features. -- -- It compile fine under GNAT 3.04a. You must add the following -- libraries : OPENGL32.LIB GLU32.LIB GLAUX.LIB -- with win32.Gl; with win32.Glaux; with Interfaces.C; with Interfaces.C.Strings; with System; with Unchecked_Conversion; procedure Cube is use win32.Gl; use win32.Glaux; use Interfaces; function Conv is new Unchecked_Conversion (System.Address, AUXRESHAPEPROC); function Conv is new Unchecked_Conversion (System.Address, AUXMAINPROC); function conv is new unchecked_conversion (system.address, win32.lpcstr); --Window_Name : aliased Interfaces.C.Char_Array := Interfaces.C.To_C ("Perspective 3-D Cube"); Window_Name : array (1..21) of aliased character := "Perspective 3-D Cube" & ascii.nul; Res : Glenum; -- callbacks must be defined with the Stdcall Convention procedure MyReshape (W, H : in Glsizei); pragma Convention (Stdcall, MyReshape); procedure Display; pragma Convention (Stdcall, Display); -- here start the definition of the gl scene. procedure MyInit is begin GlShadeModel (GL_FLAT); end MyInit; procedure MyReshape (W, H : in Glsizei) is begin GlMatrixMode (GL_PROJECTION); GlLoadIdentity; GlFrustum (-1.0, 1.0, -1.0, 1.0, 1.5, 20.0); GlMatrixMode (GL_MODELVIEW); GlViewPort (0, 0, W, H); end MyReshape; procedure Display is begin GlClear (GL_COLOR_BUFFER_BIT); GlColor3f (1.0, 1.0, 1.0); GlLoadIdentity; GlTranslatef (0.0, 0.0, -5.0); GlScalef (1.0, 2.0, 1.0); AuxWireCube (1.0); GlFlush; end Display; begin AuxInitDisplayMode (AUX_SINGLE + AUX_RGB); AuxInitPosition (0, 0, 500, 500); Res := AuxInitWindow (conv(Window_Name (Window_Name'First)'address)); MyInit; AuxReshapeFunc (Conv(MyReshape'Address)); Auxmainloop (Conv(Display'Address)); end Cube;