Bonjour
Je débute avec la programmation en C et en environnement linux (Linux scientific), je travaille avec la bibliothèque X11 pour afficher une simple fenêtre avec un bouton (Xforms).
Le code est comme suit :
#################################################
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#include "forms.h"
int main(int argc, char *argv[])
{
FL_FORM *simpleform;
fl_initialize(&argc, argv, "FormDemo", 0, 0);
simpleform = fl_bgn_form(FL_UP_BOX,230,160);
fl_add_button(FL_NORMAL_BUTTON,40,50,150,60,"Push Me");
fl_end_form();
fl_show_form(simpleform, FL_PLACE_MOUSE, FL_NOBORDER, "PushMe");
fl_do_forms();
fl_hide_form(simpleform);
return 0;
} |
#################################################
Pour la compilation je fais :
# gcc –O –o pushme pushme.c -lforms -lX11 -lM
J’obtiens le message d’erreur suivant :
[root@localhost push]# gcc -O -o pushme pushme.c -lforms -lX11 -lm
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libforms.so: undefined reference to `XpmReadFileToPixmap'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libforms.so: undefined reference to `XpmCreatePixmapFromData'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libforms.so: undefined reference to `XpmAttributesSize'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libforms.so: undefined reference to `XpmFreeAttributes'
collect2: ld a retourné 1 code d'état d'exécution
Quel qu’un peux m’aider ?!!
Partager