Results 1 to 4 of 4

Thread: Problem compiling OpenGL

  1. #1
    Join Date
    Jan 2009
    Posts
    66

    Problem compiling OpenGL

    I have a project to openGL for my computer classes but I'm stuck! Whenever I want to draw a cylinder by calling glutSolidCylinder, I have the following error compiling:

    / usr / bin / ld: Undefined symbols:
    _glutSolidCylinder
    collect2: ld returned 1 exit status

    So if I call the function glutSolidTeapot noproblem I see a beautiful teapot!

    In glut.h, there is no trace of glutSolidCylinder through against all the other functions are ...

    Someone has an idea of the source of the problem?

    I compile with gcc with the following options:-framework OpenGL-framework GLUT-framework Foundation

    Thank you.

  2. #2
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Problem compiling OpenGL

    here is code fro you try it

    Code:
    / **
    GluCylinder void * (* GLUquadric quad,
    * GLdouble base,
    * GLdouble top,
    * GLdouble height,
    * Glint slices,
    * Glint stacks)
    *
    * /

    # define glutSolidCylinder (base, altura, slices, stacks) gluCylinder (gluNewQuadric (), base, base
    , Height, slices, stacks)

    void glutSolidCylinder (float r, float h, int n, int m)
    (
    glPushMatrix ();
    glRotatef (90,1.0 F, 0.0F, 0.0F);
    glTranslatef (0.0F, 0.0F,-h / 2);
    GLUquadricObj * qobj = gluNewQuadric ();
    gluQuadricDrawStyle (qobj, GLU_FILL);
    gluCylinder (qobj, r, r, h, n, m);
    gluDeleteQuadric (qobj);
    glPopMatrix ();
    )

  3. #3
    Join Date
    May 2008
    Posts
    2,297

    Re: Problem compiling OpenGL

    this is helpful to you with above code

    # define glutSolidCylinder (base, height, slices, stacks) gluCylinder (gluNewQuadric (), base, base, height, slices, stacks)

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Problem compiling OpenGL

    As I use a mac and therefore Mac OS X, I tried to compile a file using the GLUT library.

    While Linux use the library:
    # include <GL/glut.h>

    As the following command to compile:
    gcc-o nom_executable source.c-L / usr / X11R6 / lib-lglut

    On Mac OS X, it should replace these libraries with those included with Xcode, X11 and Developer Tools:

    <OpenGL/gl.h> # include / / Header File to Library OpenGL32
    <OpenGL/glu.h> # include / / Header File to Library GLu32
    <GLUT/glut.h> # include / / Header file for Glut Library

    And use the following command to compile:
    gcc-framework GLUT-framework OpenGL-framework Cocoa-o source.c nom

Similar Threads

  1. OpenGL problem in Quake 3 on Windows 7
    By Noverism in forum Video Games
    Replies: 8
    Last Post: 19-12-2011, 10:57 PM
  2. Problem in compiling Threadpool functions like QueUserWorkItem()
    By Laalamani in forum Software Development
    Replies: 6
    Last Post: 25-09-2010, 12:04 PM
  3. Problem compiling Wine 1.1.36 on Mac OS X
    By L-cynthiya in forum Operating Systems
    Replies: 5
    Last Post: 12-01-2010, 07:42 PM
  4. Problem compiling with Generic
    By Macadrian in forum Software Development
    Replies: 4
    Last Post: 12-12-2009, 06:38 PM
  5. Urban Terror: load OpenGL problem
    By SRTDodge05 in forum Video Games
    Replies: 4
    Last Post: 23-03-2009, 03:18 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,573,183.30790 seconds with 17 queries