[Risolto] installazione opengl

Salve a tutti
ho bisogno di lavorare con le funzioni opengl.ho digitato questi comandi nella shell ma ancora non ho avuto successo:

sudo yum install glut
sudo yum install glew
tar -xvzf MesaLib-7.5.tar.gz
cd Mesa-7.5
./configure --prefix=/usr

A questo punto ottengo questo errore:
configure: error: X11 development libraries needed for dri

Potreste darmi una mano?
grazie anticipatamente

Quali output ha avuto con quei comandi ?

Tutti i comandi sono stati eseguiti con successo tranne l’ultimo:

$ ./configure --prefix=/usr
checking build system type… i686-pc-linux-gnu
checking host system type… i686-pc-linux-gnu
checking for gcc… gcc
checking for C compiler default output file name… a.out
checking whether the C compiler works… yes
checking whether we are cross compiling… no
checking for suffix of executables…
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether gcc accepts -g… yes
checking for gcc option to accept ISO C89… none needed
checking how to run the C preprocessor… gcc -E
checking for gcc… (cached) gcc
checking whether we are using the GNU C compiler… (cached) yes
checking whether gcc accepts -g… (cached) yes
checking for gcc option to accept ISO C89… (cached) none needed
checking for g++… no
checking for c++… no
checking for gpp… no
checking for aCC… no
checking for CC… no
checking for cxx… no
checking for cc++… no
checking for cl.exe… no
checking for FCC… no
checking for KCC… no
checking for RCC… no
checking for xlC_r… no
checking for xlC… no
checking whether we are using the GNU C++ compiler… no
checking whether g++ accepts -g… no
checking for gmake… gmake
checking for makedepend… no
checking for sed… /bin/sed
checking for pkg-config… /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0… yes
checking whether to enable assembly… yes, x86
checking for gcc option to produce PIC… -fPIC
checking for dlopen… no
checking for dlopen in -ldl… yes
checking for posix_memalign… yes
checking pkg-config files for X11 are available… no
checking for X… no
configure: error: X11 development libraries needed for dri driver

[quote]L’rpm “glut” non mi risulta esistente nei repo.

Prova ad installare queste librerie

# yum install libX11-devel

e ritenta la compilazione.[/quote]

Sono nei repo updates-testing.

Mi sembra evidente che tutti quei “no” propendano per una mancanza degli strumenti di sviluppo…
Che cosa vuoi fare?
Le librerie per mesa opengl sono già presenti nei repo ufficiali.

devo farecose banali del tipo disegnare un cubo con opengl, ecc.
mi hanno indicato come programmino iniziale quello disponibile su wikipedia (per disegnare un triangolo):
/*************************************************************

  • Per compilare con gcc su Linux: *
  • gcc file.c -lglut *
  • oppure: *
  • gcc file.c -L/usr/X11R6/lib -lglut -lXmu -lGL -lGLU -lXi *
    *************************************************************/

#include <GL/gl.h> // File header per la libreria OpenGL
#include <GL/glut.h> // File header per la libreria GLUT
#include <stdlib.h> // File header per usare ‘exit()’

/* Funzione invocata quando la finestra viene ridimensionata (anche quando viene creata) */
void
resize (int width, int height)
{
glViewport (0, 0, width, height); // Usiamo tutta finestra
glMatrixMode (GL_PROJECTION); // Seleziona di usare la matrice ‘PROJECTION’
glLoadIdentity (); // Resetta la matrice ‘PROJECTION’
glMatrixMode (GL_MODELVIEW); // Seleziona di usare la matrice ‘MODELVIEW’
glLoadIdentity (); // Resetta la matrice ‘MODELVIEW’
}

/* Funzione di disegno */
void
draw ()
{
glClearColor (0.0f, 0.0f, 0.0f, 0.0f); // Sfondo nero
glClear (GL_COLOR_BUFFER_BIT); // Cancella la scena

glBegin (GL_TRIANGLES); // Disegna un triangolo
glColor3f (1.0f, 0.0f, 0.0f); // Impostiamo il colore rosso
glVertex3f ( 0.0f, 0.5f, 0.0f); // Angolo in alto
glColor3f (0.0f, 1.0f, 0.0f); // Imposta il colore verde
glVertex3f (-0.5f, -0.5f, 0.0f); // Angolo basso sinistro
glColor3f (0.0f, 0.0f, 1.0f); // Imposta il colore blu
glVertex3f (0.5f, -0.5f, 0.0f); // Angolo basso destro
glEnd (); // Fine triangolo

glutSwapBuffers (); // Disegna!
}

/* Funzione invocata ogni volta che viene premuto un tasto */
void
keyPressed (unsigned char key, int x, int y)
{
if (key == ‘q’) // Se il tasto premuto e` q,
exit (0); // esce
}

/* Main */
int
main (int argc, char **argv)
{
glutInit (&argc, argv); // Inizializza la libreria GLUT
glutInitDisplayMode (GLUT_RGB|GLUT_DOUBLE); // Seleziona il modo di visualizzazione: usa RGB e double buffer
glutInitWindowSize (640, 480); // Imposta la dimensione della finestra a 640x480
glutInitWindowPosition (0, 0); // Imposta la posizione dell’angolo alto sinistro della finestra
glutCreateWindow (“Esempio uso OpenGL”); // Crea la finestra
glutDisplayFunc (draw); // Imposta la funzione di disegno
glutReshapeFunc (resize); // Imposta la funzione di ridimensionamento
glutKeyboardFunc (keyPressed); // Imposta la funzione per gli eventi della tastiera
glutMainLoop (); // Inizio
return (1);
}

ma non riesco a compilare neanche questo!

come ha detto Mario, le open-gl sono già installate nel sistema.
devi solo installare le devel:

# yum install mesa-libGL-devel mesa-libGLU-devel

gli errori sdi compilaizone sono diminuiti ma questi persistono:

$ gcc file.c -lglut
file.c:3:57: error: GL/glut.h: No such file or directory
file.c: In function ‘main’:
file.c:53: error: ‘GLUT_RGB’ undeclared (first use in this function)
file.c:53: error: (Each undeclared identifier is reported only once
file.c:53: error: for each function it appears in.)
file.c:53: error: ‘GLUT_DOUBLE’ undeclared (first use in this function)

dai i comandi da root:

[code]# updatedb

locate glut.h[/code]

riporta l’output.

Forse il problema a questo punto deriva dal fatto che nel sorgente gli include sono incompleti. Il comando “#include” è sempre nella forma “#include '.h’". Nel listato abbiamo invece "#include //” e “//” in C è l’equivalente del REM in BASIC. Ti consiglio di modificare il secondo include in “#include <GL/glut.h>”. Scommettiamo che spariscono un po’ di errori? Devi solo specificare gli headers, tutto qui. */

locate glut.h /usr/share/doc/freeglut-2.6.0/freeglut.html
In realtà il file glut.h non c’è, nemmeno in /usr/include/GL

Per completezza ripeto tutto quello che ho fatto finora

yum install libX11-devel
yum install glut
yum install glew
wget ftp://ftp.freedesktop.org/pub/mesa/7.6/MesaLib-7.6.tar.bz2
tar -jxvf MesaLib-7.6.tar.bz2
cd ./Mesa-7.6/
./configure --prefix=/usr
yum install mesa-libGL-devel mesa-libGLU-devel
updatedb 

per compilare

gcc file.c -lglut *

oppure

gcc file.c -L/usr/X11R6/lib -lglut -lXmu -lGL -lGLU -lXi *

l’unico comando che mi da probemi è questo:

./configure --prefix=/usr
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking for gmake... gmake
checking for makedepend... no
checking for sed... /bin/sed
checking for a BSD-compatible install... /usr/bin/install -c
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking whether to enable assembly... yes, x86
checking for gcc option to produce PIC... -fPIC
checking for dlopen... no
checking for dlopen in -ldl... yes
checking for posix_memalign... yes
checking pkg-config files for X11 are available... yes
checking for LIBDRM... yes
checking for DRI2PROTO... yes
checking for LIBDRM_RADEON... yes
checking for DRIGL... yes
checking expat.h usability... no
checking expat.h presence... no
checking for expat.h... no
configure: error: Expat required for DRI.

Prova prima:

# yum groupinstall "Strumenti di sviluppo"

OK, poi?

Prova a rilanciare il ./configure, l’output cambia?

si grazie millleeeeee