Suite au même problème :
voila la solution :
création de variables d'environnement contenant le résultat des commandes
1 2 3
|
pkg-config --cflags gtk+-2.0
pkg-config --libs gtk+-2.0 |
_________________________________________________________________
on windows, you can't do
unless you're using cygwin or msys because the windows shell (cmd) doesn't support
backtick syntax.
also, all you need to add to %PATH% is C:\GTK\bin.
what I do (since msys doesn't work on vista x64) is to type
1 2 3
|
pkg-config --cflags gtk+-2.0 > cflags.txt
pkg-config --libs gtk+-2.0 > ldflags.txt |
then copy the contents of cflags.txt into a new environment variable called GTK_CFLAGS
and copy the contents of ldflags.txt into a new environment variable called GTK_LDFLAGS,
then I make a new var called GTK_COMPILE which has this in it:
1 2
|
%GTK_CFLAGS% %GTK_LDFLAGS% |
then when I want to compile a gtk program, I can type:
1 2
|
gcc file.c -o file.exe %GTK_COMPILE% |
_________________________________________________________________
On peut aussi compiler "directement" en faisant
1 2
|
gcc file.c -o file.exe %GTK_CFLAGS% %GTK_LDFLAGS% |
J'ai trouvé cela ici.
Pour moi cela fonctionne correctement
A+
Partager