[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mesa3d-users
Subject:    Re: [Mesa3d-users] problem compiling an example
From:       Jerome Glisse <glisse () freedesktop ! org>
Date:       2008-03-09 11:20:48
Message-ID: 20080309122048.1debd09a.glisse () freedesktop ! org
[Download RAW message or body]

On Sat, 08 Mar 2008 20:47:40 -0200
Fernando Benedictti <fbenedic@medicauruguaya.com.uy> wrote:

> Hi, my name is Fernando.
> I've tried to compile the following example: rectangle.c
> 
> #include <GL/glut.h>
> 
> main() {
> 
>    InitializeAWindowPlease();
> 
>    glClearColor (0.0, 0.0, 0.0, 0.0);
>    glClear (GL_COLOR_BUFFER_BIT);
>    glColor3f (1.0, 1.0, 1.0);
>    glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
>    glBegin(GL_POLYGON);
>       glVertex3f (0.25, 0.25, 0.0);
>       glVertex3f (0.75, 0.25, 0.0);
>       glVertex3f (0.75, 0.75, 0.0);
>       glVertex3f (0.25, 0.75, 0.0);
>    glEnd();
>    glFlush();
> 
>    UpdateTheWindowAndCheckForEvents();
> }
> 
> using the following command line:
> 
> 	gcc -o rectangle rectangle.c
> 
> and i've obtained the followings messages:
> 
> /tmp/ccSbXgxD.o: In function `main':
> rectangle.c:(.text+0x12): undefined reference to
> `InitializeAWindowPlease'
> rectangle.c:(.text+0x3a): undefined reference to `glClearColor'
> rectangle.c:(.text+0x46): undefined reference to `glClear'
> rectangle.c:(.text+0x65): undefined reference to `glColor3f'
> rectangle.c:(.text+0x91): undefined reference to `glOrtho'
> rectangle.c:(.text+0x9d): undefined reference to `glBegin'
> rectangle.c:(.text+0xbc): undefined reference to `glVertex3f'
> rectangle.c:(.text+0xdb): undefined reference to `glVertex3f'
> rectangle.c:(.text+0xfa): undefined reference to `glVertex3f'
> rectangle.c:(.text+0x119): undefined reference to `glVertex3f'
> rectangle.c:(.text+0x11e): undefined reference to `glEnd'
> rectangle.c:(.text+0x123): undefined reference to `glFlush'
> rectangle.c:(.text+0x128): undefined reference to
> `UpdateTheWindowAndCheckForEvents'
> collect2: ld returned 1 exit status
> 
> I have openSuSE 10.3, and the packages of Mesa are:
> 
> Mesa-devel-7.0.1-18
> MesaGLw-7.0.1-16
> Mesa-7.0.1-18
> Mesa-devel-static-7.0.1-18
> MesaGLw-devel-7.0.1-16
> 
> Can anybody tell me what i doing wrong?
> 
> Thanks.
> Fernando.-
> 

I suggest you look at glut tutorial on the net. There is no such
function as:
InitializeAWindowPlease
InitializeAWindowPlease

Once you got a proper example code to compile:
gcc glutexample.c -o glutexample -lGL -lglut

Cheers, 
Jerome Glisse <glisse@freedesktop.org>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Mesa3d-users mailing list
Mesa3d-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic