[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Pb de compilation avec GTK 2.2.4...



Ainsi parla Alain D'EURVEILHER le 348ème jour de l'an 2003:

> Nicolas Rueff a écrit:
> 
> >Ainsi parla Alain D'EURVEILHER le 347ème jour de l'an 2003:
> >
> >  
> >
> >>pkg-config --cflags --libs gtk+-2.0
> >>    
> >>
> >
> >que donne cette commande ?
> >  
> >
> J'ai essayé ceci :
> dans mon Makefile :
> --------------
> GLIBS     = `gtk-config --libs --cflags`
> GFLAGS     = `gtk-config --cflags`
> GNLIBS     = `gnome-config --cflags --libs gnomeui`
> GNFLAGS = `gnome-config --cflags`
> GTALL     = `pkg-config --cflags --libs gtk+-2.0`
> GTFLAGS = `pkg-config --cflags gtk+-2.0`
> GTLIBS     = `pkg-config --libs gtk+-2.0`
> 
> all: reboot
> 
> reboot: reboot.o
>     cc reboot.o -o reboot $(GTALL)
> 
> reboot.o: reboot.c
>     cc reboot.c -c -o  reboot.o $(GTFLAGS)
> 
> clean:
>     rm -f *.o
> -----------------------
> Puis :
> -----------------------
> 13:17 bozz@BOZZ ~/gtk/test1% make clean && make
> rm -f *.o
> cc reboot.c -c -o  reboot.o `pkg-config --cflags gtk+-2.0`
> cc reboot.o -o reboot `pkg-config --cflags --libs gtk+-2.0`
> 13:20 bozz@BOZZ ~/gtk/test1%
> ------------------------
> 
> =>Ca semble mieux. Mais ai-je raison de faire ainsi ??

C'est un début, mais pas très clair. Une autre méthode, plus élégante
(vive les rêgles implicites):
--------------
CC	= gcc
CFLAGS 	= `pkg-config --cflags gtk+-2.0`
LDLIBS 	= `pkg-config --libs gtk+-2.0`

SOURCES=reboot.c reboot2.c
OBJS=$(SOURCES:.c=.o)
TARGET=reboot

all: $(TARGET)

$(TARGET): $(OBJS)

clean:
	rm -f $(OBJS) $(TARGET)
-----------------------

info make pour + d'infos ...

-- 
  .,p**"*=b_   Nicolas Rueff
 ?P"  .__ `*b   Montbéliard  -  France
|P  .d?'`&, 9|   http://rueff.tuxfamily.org
M:  |}   |- H'   n.rueff@free.fr
&|  `#?_._oH'   +33 6 77 64 44 80
`H.   "`"`'   GPG 0xDD44DAB4
 `#?.	    ICQ 97700474
   `^~.

We are Penguin. Resistance is futile. You will be assimilated.

Attachment: pgp3tMHpSb4oA.pgp
Description: PGP signature


Reply to: