Hi,
I tried and compiled a GTK 3 sample code in Ubuntu 18.04 OS and Code::Blocks IDE. Code is taken from
this link. And for Code::Blocks setting I used
this one.
In "Compiler setting" , "Other compiler options" I used:
pkg-config --libs gtk+-3.0
In "Linker settings":
-pthread -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0
In "Search directories" I added several but not all of above packages like:
/usr/include/
/usr/include/atk-1.0
And so on for about 8 include sources. Consequently I was able to "Build and run" my sample. A terminal was shown with a window which was expected. However I deleted first "Search directory" in order to removed all directories and build only from libraries. But now I get this error from Clang compiler:
With "Search directories":
-------------- Clean: Release in Temp (compiler: LLVM Clang Compiler 8)---------------
Cleaned "Temp - Release"
-------------- Build: Release in Temp (compiler: LLVM Clang Compiler 8)---------------
clang -m64 -pedantic -Weverything -Wall -std=c11 pkg-config --libs gtk+-3.0 -I/usr/include/ -I/usr/include/gtk-3.0 -I/usr/include/glib-2.0/ -I/usr/lib/x86_64-linux-gnu/glib-2.0/include/ -I/usr/include/pango-1.0/ -I/usr/include/cairo/ -I/usr/include/gdk-pixbuf-2.0/ -I/usr/include/atk-1.0 -c /home/mehdi/Documents/Code_Blocks_Projects/Temp/Main.c -o obj/Release/Main.o
clang: error: unsupported option '--libs'
clang: error: no such file or directory: 'pkg-config'
clang: error: no such file or directory: 'gtk+-3.0'
Process terminated with status 1 (0 minute(s), 0 second(s))
3 error(s), 0 warning(s) (0 minute(s), 0 second(s))
Without "Search directories":
-------------- Clean: Release in Temp (compiler: LLVM Clang Compiler 9 GTK)---------------
Cleaned "Temp - Release"
-------------- Build: Release in Temp (compiler: LLVM Clang Compiler 9 GTK)---------------
clang -m64 -pedantic -Weverything -Wall -std=c11 pkg-config --libs gtk+-3.0 -c /home/mehdi/Documents/Code_Blocks_Projects/Temp/Main.c -o obj/Release/Main.o
clang: error: unsupported option '--libs'
clang: error: no such file or directory: 'pkg-config'
clang: error: no such file or directory: 'gtk+-3.0'
Process terminated with status 1 (0 minute(s), 0 second(s))
3 error(s), 0 warning(s) (0 minute(s), 0 second(s))
Any help on this now ?