egallesio / STklos

STklos Scheme
http://stklos.net
GNU General Public License v2.0
69 stars 17 forks source link

gtklos.c:28:10: fatal error: gtk/gtk.h: No such file or directory #620

Closed dufresnep closed 1 month ago

dufresnep commented 8 months ago

After applying the trick: export STKLOS_GTK_DIR=/usr/lib/x86_64-linux-gnu I got:

paul@bismark:~/Téléchargements/stklos-2.00/extensions/gtklos$ LANG=C make
Making all in lib/stklos
make[1]: Entering directory '/home/paul/Téléchargements/stklos-2.00/extensions/gtklos/lib/stklos'
gcc -g -O2   -fpic -nostdlib \
          \
         -I../../../../src -I../../../../gc/include  \
         -c -o gtklos.o gtklos.c
gtklos.c:28:10: fatal error: gtk/gtk.h: No such file or directory
   28 | #include <gtk/gtk.h>
      |          ^~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:594: gtklos.so] Error 1
make[1]: Leaving directory '/home/paul/Téléchargements/stklos-2.00/extensions/gtklos/lib/stklos'
make: *** [Makefile:391: all-recursive] Error 1
paul@bismark:~/Téléchargements/stklos-2.00/extensions/gtklos$ ls

I have tried to edit it a bit, to fix the path: #include <gtk-3.0/gtk/gtk.h>

paul@bismark:~/Téléchargements/stklos-2.00/extensions/gtklos$ LANG=C make
Making all in lib/stklos
make[1]: Entering directory '/home/paul/Téléchargements/stklos-2.00/extensions/gtklos/lib/stklos'
gcc -g -O2   -fpic -nostdlib \
          \
         -I../../../../src -I../../../../gc/include  \
         -c -o gtklos.o gtklos.c
In file included from gtklos.c:28:
/usr/include/gtk-3.0/gtk/gtk.h:30:10: fatal error: gdk/gdk.h: No such file or directory
   30 | #include <gdk/gdk.h>
      |          ^~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:594: gtklos.so] Error 1
make[1]: Leaving directory '/home/paul/Téléchargements/stklos-2.00/extensions/gtklos/lib/stklos'
make: *** [Makefile:391: all-recursive] Error 1
paul@bismark:~/Téléchargements/stklos-2.00/extensions/gtklos$ 
paul@bismark:~/Téléchargements/stklos-2.00/extensions/gtklos$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:    22.04
Codename:   jammy
dufresnep commented 8 months ago

But I don't know yet where I could add the -I/usr/include/gtk-3.0

paul@bismark:~/Téléchargements/stklos-2.00/extensions/gtklos$ pkg-config --cflags gtk+-3.0
-pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/x86_64-linux-gnu -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
paul@bismark:~/Téléchargements/stklos-2.00/extensions/gtklos$ ls

found that on: https://www.linuxquestions.org/questions/programming-9/gtk-gtk-h-not-found-when-trying-to-compile-c-gtk-program-4175698277/

egallesio commented 8 months ago

Hi Paul,

If you have installed the devel package after having configured STklos, you'll have to run configure again. Normally, you should see the output of pkg-config in the file extensions/gtklos/lib/stklos/Makefile (to initialize the variable GTKFLAGS near line 345).