Hi,
I’m trying to compile a GTK application through command line/Makefile without using any IDE. I’ve followed several posts that does it with Eclipse setting cflags and libs variables but I’m unable to make it work.
- Adding gtk libraries in eclipse - Technical Support - Toradex Community
- Gtk with Eclipse to cross compile for VF61 - Technical Support - Toradex Community
At this point:
- GTK Application compiles (and works perfectly) from/to the host machine setting the PKG_CONFIG_PATH to my local path and then launching pkg-config --cflags gtk±3.0 and pkg-config --libs gtk±3.0. Compilation command is: gcc `pkg-config --cflags gtk±3.0
-o GtkExample GtkExample.c \
pkg-config --libs gtk±3.0` - I’ve generated my oe-core sdk in ~/SDK_Angstrom instead of leaving the default one.
- My SDK generates pkg-config but I don’t find any gtk there so I’m guessing that it uses the same gtk…pc
After I’ve sourced ~/Angstrom_SDK/environment-setup-armv7at2hf-neon-angstrom-linux-gnueabi, I’ve tried the following commands:
1st try: Try to configure pkg-config flags with mine.
$ pkg-config --cflags gtk±3.0
This returns that the package gtk±3.0 is not found in the search path.
2nd try: Try to compile directly:
${CC} ${CFLAGS} -c --sysroot=/home/alvaro/Angstrom_SDK/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/ `/home/alvaro/Angstrom_SDK/sysroots/x86_64-angstromsdk-linux/usr/bin/pkg-config --cflags gtk±3.0` GtkExample.c -o GtkExample
This returns the same than the 1st with the addition if “gtk/gtk.h: No such file or directory”.
3rd try: Same commands but with gtk±2.0
Same results.
I’m guessing that it’s failing to get the include/libs for gtk for ARM from the SDK (which I’m unable to find). I also fail to understand if the .pc is the same because I don’t how by changing the pkgconfig path it does find the gtk pc in the Eclipse examples.
Thanks, Álvaro.