X11

X11 - C - Programmation

Marsh Posté le 13-01-2009 à 16:25:36    

Bonjour,
J'avais déja eu un debut de réponse a mes questions et comme je me suis remis dans le problème je reviens.
J'ai fait un petit bout de code tout simple
 

Code :
  1. #include <unistd.h>
  2. #include <stdlib.h>
  3. #include <curses.h>
  4. #include <stdio.h>
  5. #include "Xlib.h"
  6. main()
  7. {
  8. }


 
Puis j'ai chercher le hearder Xlib. qui se trouve dans:
/opt/OpenSource/xcdroast-0.98/opt/gcc/lib/gcc-lib/hppa2.0n-hp-hpux11.00/3.0.1/include/X11
 
Alors j'ai essayé de compiler en tapant:
cc x11test.c -o x11test -I /opt/OpenSource/xcdroast-0.98/opt/gcc/lib/gcc-lib/hppa2.0n-hp-hpux11.00/3.0.1/include/X11
 
et j'ai eu comme réponse:
 
cpp: "/opt/OpenSource/xcdroast-0.98/opt/gcc/lib/gcc-lib/hppa2.0n-hp-hpux11.00/3.0.1/include/X11/Xlib.h", line 68: error 4036: Can't open include file 'X11/X.h'.
cpp: "/opt/OpenSource/xcdroast-0.98/opt/gcc/lib/gcc-lib/hppa2.0n-hp-hpux11.00/3.0.1/include/X11/Xlib.h", line 71: error 4036: Can't open include file 'X11/Xfuncproto.h'.
cpp: "/opt/OpenSource/xcdroast-0.98/opt/gcc/lib/gcc-lib/hppa2.0n-hp-hpux11.00/3.0.1/include/X11/Xlib.h", line 72: error 4036: Can't open include file 'X11/Xosdefs.h'.
 
Ce que je comprends c'est que dans mon fichier d'entete Xlib.h il y a des includes que ne sont pas trouvés.
Comment savoir si je peuts utiliser ou pas des fichiers d'entetes.

Reply

Marsh Posté le 13-01-2009 à 16:25:36   

Reply

Marsh Posté le 13-01-2009 à 16:35:36    

Tu devrais mettre #include "X11/Xlib.h" ("X11/Xlib.h" au lieux de simplement "Xlib.h" ) dans ton .c, et ne pas mettre le "X11" dans le -I de ta ligne de commande (ton -I doit s'arrêter à ".../include" ).

Reply

Marsh Posté le 14-01-2009 à 10:17:41    

Bonjour,
Toujours le même souci.
cc x11test.c -o x11test -I /opt/OpenSource/xcdroast-0.98/opt/gcc/lib/gcc-lib/hppa2.0n-hp-hpux11.00/3.0.1/include
cpp: "/opt/OpenSource/xcdroast-0.98/opt/gcc/lib/gcc-lib/hppa2.0n-hp-hpux11.00/3.0.1/include/stdio.h", line 42: warning 2001: Redefinition of macro __va__list.
cpp: "/opt/OpenSource/xcdroast-0.98/opt/gcc/lib/gcc-lib/hppa2.0n-hp-hpux11.00/3.0.1/include/syslimits.h", line 7: error 4052: Unknown preprocessing directive.
cpp: "/opt/OpenSource/xcdroast-0.98/opt/gcc/lib/gcc-lib/hppa2.0n-hp-hpux11.00/3.0.1/include/X11/Xlib.h", line 68: error 4036: Can't open include file 'X11/X.h'.
cpp: "/opt/OpenSource/xcdroast-0.98/opt/gcc/lib/gcc-lib/hppa2.0n-hp-hpux11.00/3.0.1/include/X11/Xlib.h", line 71: error 4036: Can't open include file 'X11/Xfuncproto.h'.
cpp: "/opt/OpenSource/xcdroast-0.98/opt/gcc/lib/gcc-lib/hppa2.0n-hp-hpux11.00/3.0.1/include/X11/Xlib.h", line 72: error 4036: Can't open include file 'X11/Xosdefs.h'.
 
Autre point, dans mon programme je mets les includes mais comment je sais si dois specifier le chemin pour le link.

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed