cancel
Showing results for 
Search instead for 
Did you mean: 

#include <gtk/gtk.h> in STM32IDE issue

RSmit.11
Associate

I've followed this:

https://www.youtube.com/watch?app=desktop&v=qEzfqKt3exE&list=PLnMKNibPkDnFp5YvrvWjgfjrOs0Vi34Mt&index=5

and set up project in STMCUBEIDE

when i try and include #include <gtk/gtk.h>

i get the following

make all

Wrapper for /opt/st/stm32cubeide_1.9.0/plugins/com.st.stm32cube.ide.mpu.linux.toolchain_2.0.0.202105061257/tools/bin/make

FIP_DEPLOYDIR_ROOT: /home/reece/STM32CubeIDE/workspace_1.9.0/SterlingAcsses/Debug/../../FIP_artifacts

+ case "$command" in

+ exec make all

Building file: ../main.c

Invoking: MPU GCC Compiler

arm-ostl-linux-gnueabi-gcc -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/home/reece/.eclipse/com.st.stm32cube.ide.mcu.rcp.product_1.9.0_1935169236_linux_gtk_x86_64/plugins/com.st.openstlinux.sdk.openstlinux_5.10_dunfell_mp1_21_11_17_5.10.0.202111171131/tools/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi "../main.c" -std=gnu11 -g3 -c -I/home/reece//.eclipse/com.st.stm32cube.ide.mcu.rcp.product_1.9.0_1935169236_linux_gtk_x86_64/plugins/com.st.openstlinux.sdk.openstlinux_5.10_dunfell_mp1_21_11_17_5.10.0.202111171131/tools/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include -Og -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"main.d" -MT"main.o" -o "main.o"

../main.c:10:10: fatal error: gtk/gtk.h: No such file or directory

  10 | #include <gtk/gtk.h>

     |         ^~~~~~~~~~~

compilation terminated.

make: *** [subdir.mk:20: main.o] Error 1

"make all" terminated with exit code 2. Build might be incomplete.

1 REPLY 1
Erwan SZYMANSKI
ST Employee

Hello @RSmit.11​ ,

When you work with GTK, you have different library and flags to use at compilation time.

For example, using a traditional Makefile, we have something like this:

CFLAGS += $(shell pkg-config --cflags gtk+-3.0)

LDFLAGS += $(shell pkg-config --libs gtk+-3.0)

Are you sure your compilation flags options are well set in your CubeIDE ?

Regards.

Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.