Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2625 connectés 

  FORUM HardWare.fr
  Linux et OS Alternatifs

  Glut/OpenGL sous Debian

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Glut/OpenGL sous Debian

n°644670
xiluoc
un pc pour les unirs ....
Posté le 04-03-2005 à 03:06:21  profilanswer
 

:hello: ,
On commence la programmation opengl, Tous le monde fait ca sous visual C++.
Mais j ai vraiment pas envie de rebooter pour ca.
Opengl est bien installer, du moins pour leus jeux ca tourne bien.
 
que dois-ja faire pour faire tourner ce code ?

Code :
  1. /*
  2. * hello2.c
  3. * This is a simple, introductory OpenGL program.
  4. * A white filled square on a black background is displayed.
  5. * This program is in a sense the shortest one which
  6. * produces the same effect as hello.c (from "red book" ).
  7. *  
  8. * Scott McCallum February 2003
  9. */
  10. #include <GL/glut.h>
  11. void display(void)
  12. {
  13. /* clear entire screen window to background colour (black) */
  14.    glClear(GL_COLOR_BUFFER_BIT);
  15. /* in standard square (with corners at (-1,-1) and (1,1) )
  16. * draw white filled square with corners at
  17. * (-0.5, -0.5) and (0.5, 0.5)   
  18. */
  19.    glRectf(-0.5, -0.5, 0.5, 0.5);
  20. /* flush buffer */
  21.    glFlush();
  22. }
  23. /*  
  24. * Declare initial window size and position.
  25. * Open window with "hello" in its title bar.  
  26. * Register callback function to display graphics.
  27. * Enter main loop and wait for termination.
  28. */
  29. int main(int argc, char** argv)
  30. {
  31.    glutInit(&argc, argv);
  32.    glutInitWindowSize(250, 250);
  33.    glutInitWindowPosition(100, 100);
  34.    glutCreateWindow ("hello" );
  35.    glutDisplayFunc(display);
  36.    glutMainLoop();
  37.    return 0;
  38. }


 
j ai essayer apt-get install glutd3
puis  

Code :
  1. gcc -o h hello2.c -lGL -lGLU


mais ca donne rien  

Code :
  1. /tmp/cc4lal1v.o(.text+0x5f): In function `main':
  2. : undefined reference to `glutInit'
  3. /tmp/cc4lal1v.o(.text+0x73): In function `main':
  4. : undefined reference to `glutInitWindowSize'
  5. /tmp/cc4lal1v.o(.text+0x87): In function `main':
  6. : undefined reference to `glutInitWindowPosition'
  7. /tmp/cc4lal1v.o(.text+0x93): In function `main':
  8. : undefined reference to `glutCreateWindow'
  9. /tmp/cc4lal1v.o(.text+0x9f): In function `main':
  10. : undefined reference to `glutDisplayFunc'
  11. /tmp/cc4lal1v.o(.text+0xa4): In function `main':
  12. : undefined reference to `glutMainLoop'
  13. collect2: ld returned 1 exit status
  14. zsh: exit 1     gcc -o h hello2.c -lGL -lGLU


mood
Publicité
Posté le 04-03-2005 à 03:06:21  profilanswer
 

n°644674
xiluoc
un pc pour les unirs ....
Posté le 04-03-2005 à 04:07:39  profilanswer
 

j ai ajoute  
apt-get install mesag3
apt-get install  mesag3-dev
 
puis
 
ln -s /usr/lib/libglut.so.3 /usr/lib/libglut.so
ln -s /usr/lib/libGLU.so.1 /usr/lib/libGLU.so
ln -s /usr/lib/libGL.so.1 /usr/lib/libGL.so
 
suivit de  

Code :
  1. gcc -o h hello2.c -lGL -lGLU
  2. /tmp/ccWad4OB.o(.text+0x5f): In function `main':
  3. : undefined reference to `glutInit'
  4. /tmp/ccWad4OB.o(.text+0x73): In function `main':
  5. : undefined reference to `glutInitWindowSize'
  6. /tmp/ccWad4OB.o(.text+0x87): In function `main':
  7. : undefined reference to `glutInitWindowPosition'
  8. /tmp/ccWad4OB.o(.text+0x93): In function `main':
  9. : undefined reference to `glutCreateWindow'
  10. /tmp/ccWad4OB.o(.text+0x9f): In function `main':
  11. : undefined reference to `glutDisplayFunc'
  12. /tmp/ccWad4OB.o(.text+0xa4): In function `main':
  13. : undefined reference to `glutMainLoop'
  14. collect2: ld returned 1 exit status
  15. zsh: exit 1     gcc -o h hello2.c -lGL -lGLU


 
:/


Message édité par xiluoc le 04-03-2005 à 04:08:29
n°644675
xiluoc
un pc pour les unirs ....
Posté le 04-03-2005 à 04:13:05  profilanswer
 

resolu :)
gcc -o h hello2.c  -lglut -lGLU -lGL

n°652386
Telchar
Posté le 20-03-2005 à 14:45:54  profilanswer
 

Je dois aussi programmer en openGL sous linux.
Dans les paquets de ma distrib (debian), je vois des libs mesag3.. et des xlibmesa..
Je n'arrive pas à comprendre la difference entre les deux, et donc je ne sais pas laquelle je dois utiliser.
Je suppose que je suis obligé de passer par mesa de toute facon  :??:  
 

n°698620
xiluoc
un pc pour les unirs ....
Posté le 27-06-2005 à 08:17:45  profilanswer
 
n°698644
black_lord
Modérateur
Truth speaks from peacefulness
Posté le 27-06-2005 à 10:09:34  profilanswer
 

dans un makefile :
 


 
GL_OPTS=-L/usr/X11R6/lib/ -lGLU -lGL -lXmu -lXi -lm -lglut
OBJS= les objets en .o
TARGET=nom_du_prog
CC=gcc
CC_OPTS= -g
GLOB=globals.h
COMPIL=$(CC) $(CC_OPTS)
 
$(TARGET):
 
clean:
        rm -f *.o $(TARGET)
 
( construction des objets )
 
$(TARGET): $(GLOB) $(OBJS) main.c
        $(COMPIL) main.c $(OBJS) -o $(TARGET) $(GL_OPTS)


---------------
uptime is for lousy system administrators what Viagra is for impotent people - mes unixeries - github me
n°698660
_darkalt3_
Proctopathe
Posté le 27-06-2005 à 10:42:27  profilanswer
 
n°698681
miminou
Posté le 27-06-2005 à 11:43:12  profilanswer
 

Telchar a écrit :

Je dois aussi programmer en openGL sous linux.
 
Je suppose que je suis obligé de passer par mesa de toute facon  :??:


si tu as des drivers graphiques avec openGL , pas de MESA.
MESA c'est une implementation openGL software
 
 :hello:


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Linux et OS Alternatifs

  Glut/OpenGL sous Debian

 

Sujets relatifs
De l'opengl sans dri ?[debian] debian + drivers wifi en mode scanning
[Debian] Problème configuration internet[résolu] Debian : problème d'accès internet
[Debian] Tomcat/apachecomment desinstaller le multiboot debian
[fetchmail debian sarge] Serveur de messagerie sur domaine en .fr[Debian] éviter qu'un demon se lance au démarrage ?
Reiser4 : jamais pour debian ?[Debian] MTAB & FSTAB
Plus de sujets relatifs à : Glut/OpenGL sous Debian


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR