Re: [ooc-compiler] Undefined reference from interface module
Brought to you by:
mva
|
From: Stewart G. <sgr...@ii...> - 2004-06-03 00:37:39
|
Hi August, If you're working with OpenGL, you might like to check out my "quick-and-dirty" translation here: http://maple.murdoch.edu.au/~stewart/files/interfaces/gl/ The module GL.Mod is derived from "gl.h" and "glu.h" under Windows NT. It needs a some cleaning up, but should be usable. For example, there are numerous "AutoPtr_" declarations which are generated to remove type constructors in procedure declarations. These should be given names that are meaningful in context. I did this a while back, but never tested it (other than verifying that it compiles) since I eventually managed to do what I wanted using GDI functions. I suspect that if you add your "LINK LIB" declarations to the module header it will probably work. Either way, I'd be interested to know if you have any success with it. Cheers, Stewart On Friday, May 28, 2004, at 09:12 AM, August wrote: > I'm trying to port OpenGL and GLUT to OOC. I can successfully compile > and > link the following(meaningless) C-program with `gcc > opengltest.c -lopengl32 -lglu32 -lglut32'. > > opengltest.c > ------------ > #include <GL/glut.h> > int main(int argc, char *argv[]) > { > glutMainLoop(); > return 0; > } > > When I try to compile `OpenGLTest.Mod' (shown below) with `oo2c -M -r > .. > OpenGLTest.Mod' I get an error from the linker saying: > > /home/adm/ob2/lib/obj/OpenGLTest.o(.text+0x35):OpenGLTest.c: undefined > reference to `glutMainLoop' > > Any ideas? Is there a way to see what `gcc' command `oo2c' invokes > (verbose > option or something)? > > Thanks in advance, > August > > Glut.Mod > ---------- > MODULE Glut [INTERFACE "C"; LINK LIB "opengl32"; LIB "glu32"; LIB > "glut32" > END]; > PROCEDURE ["glutMainLoop"] MainLoop*(); > END Glut. > > OpenGLTest.Mod > ------------------- > MODULE OpenGLTest; > IMPORT Glut; > BEGIN > Glut.MainLoop(); > END OpenGLTest. > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle > 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > _______________________________________________ > ooc-compiler mailing list > ooc...@li... > https://lists.sourceforge.net/lists/listinfo/ooc-compiler > |