How to: Use OpenGL with Jgrasp

This is a discussion on How to: Use OpenGL with Jgrasp within the Game Programming forums, part of the General Programming Boards category; Hi I'm attempting to write games in C using OpenGL, however I am having difficulty compiling any code whatsoever. I'm ...

  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    7

    How to: Use OpenGL with Jgrasp

    Hi I'm attempting to write games in C using OpenGL, however I am having difficulty compiling any code whatsoever. I'm using Jgrasp + cygwin w/ Gcc.

    ----jGRASP exec: gcc -g C:\Documents and Settings\Daniel\Desktop\Programs\Random\mmkl.c

    /cygdrive/c/DOCUME~1/Daniel/LOCALS~1/Temp/ccVWGDKU.o: In function `Init':
    mmkl.c:14: undefined reference to `_glClearColor@16'
    mmkl.c:15: undefined reference to `_glClearAccum@16'
    mmkl.c:17: undefined reference to `_glGenLists@4'
    mmkl.c:18: undefined reference to `_glNewList@8'
    mmkl.c:19: undefined reference to `_glColor3f@12'
    mmkl.c:20: undefined reference to `_glRectf@16'
    mmkl.c:21: undefined reference to `_glEndList@0'
    mmkl.c:23: undefined reference to `_glGenLists@4'
    mmkl.c:24: undefined reference to `_glNewList@8'
    mmkl.c:25: undefined reference to `_glColor3f@12'
    mmkl.c:26: undefined reference to `_glRectf@16'
    mmkl.c:27: undefined reference to `_glEndList@0'
    /cygdrive/c/DOCUME~1/Daniel/LOCALS~1/Temp/ccVWGDKU.o: In function `Reshape':
    mmkl.c:33: undefined reference to `_glViewport@16'
    mmkl.c:35: undefined reference to `_glMatrixMode@4'
    mmkl.c:36: undefined reference to `_glLoadIdentity@0'
    mmkl.c:37: undefined reference to `_glMatrixMode@4'
    mmkl.c:38: undefined reference to `_glLoadIdentity@0'
    /cygdrive/c/DOCUME~1/Daniel/LOCALS~1/Temp/ccVWGDKU.o: In function `Key':
    mmkl.c:46: undefined reference to `_glPolygonMode@8'
    mmkl.c:47: undefined reference to `_glutPostRedisplay@0'
    mmkl.c:50: undefined reference to `_glPolygonMode@8'
    mmkl.c:51: undefined reference to `_glutPostRedisplay@0'
    /cygdrive/c/DOCUME~1/Daniel/LOCALS~1/Temp/ccVWGDKU.o: In function `Draw':
    mmkl.c:61: undefined reference to `_glPushMatrix@0'
    mmkl.c:63: undefined reference to `_glScalef@12'
    mmkl.c:65: undefined reference to `_glClear@4'
    mmkl.c:66: undefined reference to `_glCallList@4'
    mmkl.c:67: undefined reference to `_glAccum@8'
    mmkl.c:69: undefined reference to `_glClear@4'
    mmkl.c:70: undefined reference to `_glCallList@4'
    mmkl.c:71: undefined reference to `_glAccum@8'
    mmkl.c:73: undefined reference to `_glAccum@8'
    mmkl.c:75: undefined reference to `_glPopMatrix@0'
    mmkl.c:78: undefined reference to `_glutSwapBuffers@0'
    mmkl.c:81: undefined reference to `_glFlush@0'
    /cygdrive/c/DOCUME~1/Daniel/LOCALS~1/Temp/ccVWGDKU.o: In function `main':
    mmkl.c:105: undefined reference to `_glutInit@8'
    mmkl.c:110: undefined reference to `_glutInitDisplayMode@4'
    mmkl.c:111: undefined reference to `_glutInitWindowSize@8'
    mmkl.c:112: undefined reference to `_glutCreateWindow@4'
    mmkl.c:116: undefined reference to `_glutReshapeFunc@4'
    mmkl.c:117: undefined reference to `_glutKeyboardFunc@4'
    mmkl.c:118: undefined reference to `_glutDisplayFunc@4'
    mmkl.c:119: undefined reference to `_glutMainLoop@0'
    collect2: ld returned 1 exit status

    ----jGRASP wedge2: exit code for process is 1.
    ----jGRASP: operation complete.

  2. #2
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    you need to link the opengl libraries.

  3. #3
    Registered User
    Join Date
    Aug 2005
    Posts
    7
    Sorry for asking this but how do I go aboutdoing that? Thanks :P

  4. #4
    Registered User
    Join Date
    Aug 2005
    Posts
    7
    Been google'ing my butt off trying to figure this out. There is a 'Compile and Link' button in jgrasp but I think there must be more to it that I am missing.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 10:17 AM
  2. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  3. OpenGL .dll vs video card dll
    By Silvercord in forum Game Programming
    Replies: 14
    Last Post: 02-12-2003, 06:57 PM
  4. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 10:14 PM
  5. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 09:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21