Foro de elhacker.net

Programación => Programación C/C++ => Mensaje iniciado por: tomsb en 27 Noviembre 2016, 16:56 pm



Título: ayuda error al compilar c++ con ALLEGRO5
Publicado por: tomsb en 27 Noviembre 2016, 16:56 pm
hola a todos primero que nada gracias por sus aportes.
tengo una problema al compilar en el terminal de ubuntu
instale la libreria de ALLEGRO5
quiero probar si esta todo bien y coloco lo siguiente en el terminal:    c++ -Wall prueba.cpp `pkg-config --cflags --libs allegro-5.0 allegro_primitives-5.0`

 y me sale :


In file included from /usr/include/allegro5/internal/alconfig.h:55:0,
                 from /usr/include/allegro5/base.h:50,
                 from /usr/include/allegro5/allegro.h:26,
                 from prueba.cpp:2:
/usr/include/allegro5/platform/alucfg.h:53:2: error: #error Unix Allegro now REQUIRES pthreads
 #error Unix Allegro now REQUIRES pthreads
  ^
In file included from /usr/include/allegro5/base.h:50:0,
                 from /usr/include/allegro5/allegro.h:26,
                 from prueba.cpp:2:
/usr/include/allegro5/inline/fmaths.inl: In function ‘int al_fixtoi(al_fixed)’:
/usr/include/allegro5/inline/fmaths.inl:207:1: error: ‘al_fixfloor’ was not declared in this scope
 AL_INLINE(int, al_fixtoi, (al_fixed x),


alguien me puede decir que esta mal si falta algo


Título: Re: ayuda error al compilar c++ con ALLEGRO5
Publicado por: ivancea96 en 27 Noviembre 2016, 17:57 pm
No estoy seguro, pero como dice que requierepthread, prueba agregando -lpthread


Título: Re: ayuda error al compilar c++ con ALLEGRO5
Publicado por: tomsb en 27 Noviembre 2016, 18:53 pm
probe con -lpthread y nada
este el codigo , creo q aqui no hay problema , el problema es al momento de compilar  :-[


Código
  1. #include <allegro5/allegro.h>
  2. #include <allegro5/allegro_native_dialog.h>
  3.  
  4.  
  5.  
  6. void allegro_start(char *title,int width, int height)
  7. {
  8. allegro_init();
  9. set_color_depth(24);
  10. set_gfx_mode(GFX_AUTODETECTED_WINDOWED,windth,height,0,0);
  11. set_window_title(title);
  12.  
  13. install_keyboard();
  14. install_mouse();
  15. install_timer();
  16.  
  17. }
  18.  
  19. int main()
  20. {
  21. allegro_start("TEST ",400,300);
  22. while(!keypressed());
  23.  
  24.    return 0;
  25.  
  26. }


Mod: Los códigos deben ir en etiquetas GeSHi