Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 26/04/2007, à 12:45

ASAD

serveur X

Bonjour.
j'ai installé ubuntu 6... , gcc ainsi que les libraires X11. Quand je compile une fonction appelant des primitives telles XSETFUNCTION, j'ai le message  'Références indéfinies vers xsetfunction'.
je comprends bin qu'il n'arrive pas à atteindre la fonction pour l'edition de lien mais pourquoi ?
merci du coup de main...
ASAD

#2 Le 26/04/2007, à 12:56

Desintegr

Re : serveur X

Peut-être que tu ne lui dis pas vers quel bibliothèque tu veux faire le lien. smile

Petit extrait du manuel de gcc :

-llibrary
       -l library
           Search the library named library when linking.  (The second alter‐
           native with the library as a separate argument is only for POSIX
           compliance and is not recommended.)

           It makes a difference where in the command you write this option;
           the linker searches and processes libraries and object files in the
           order they are specified.  Thus, foo.o -lz bar.o searches library z
           after file foo.o but before bar.o.  If bar.o refers to functions in
           z, those functions may not be loaded.

           The linker searches a standard list of directories for the library,
           which is actually a file named liblibrary.a.  The linker then uses
           this file as if it had been specified precisely by name.

           The directories searched include several standard system directo‐
           ries plus any that you specify with -L.

           Normally the files found this way are library files---archive files
           whose members are object files.  The linker handles an archive file
           by scanning through it for members which define symbols that have
           so far been referenced but not defined.  But if the file that is
           found is an ordinary object file, it is linked in the usual fash‐
           ion.  The only difference between using an -l option and specifying
           a file name is that -l surrounds library with lib and .a and
           searches several directories.


Hoc Volo, Sic Jubeo !
Mon wiki : http://desintegr.free.fr

Hors ligne

#3 Le 26/04/2007, à 22:36

ASAD

Re : serveur X

dans quelle librairie peut se trouver XSETFUNCTION ?

#4 Le 27/04/2007, à 06:52

Desintegr

Re : serveur X

Bah, tu l'as dis toi même :

ainsi que les libraires X11.

XSetFunction se trouve dans X11/Xlib.h et tu fais bien l'édition des liens avec -lX11 ?

$ objdump -T /usr/X11R6/lib/libX11.so | grep XSetFunction
000000000003e640 g    DF .text  0000000000000074  Base        XSetFunction

Les double-posts sont une des meilleures techniques pour ne pas obtenir de réponse.

http://forum.ubuntu-fr.org/viewtopic.php?pid=885610#p885610

Dernière modification par Desintegr (Le 27/04/2007, à 07:07)


Hoc Volo, Sic Jubeo !
Mon wiki : http://desintegr.free.fr

Hors ligne