Hello everyone!. After going through the basics of C, I’ve decided I tried to learn GTK.
I’m using Fedora Linux 33, while using the latest Gnome-Builder package from Flatpak.
I and following the getting started guide from the GTK documentation here.
Code compiles and runs properly as expected, but Gnome-Builder spews out underlined errors everywhere as ween below.
From what I can see in your screenshot you are building your program manually on the command line. But Builder needs you to setup a minimal buildsystem so it can build and run your program. Nowadays the way to go is to use the meson build system. If you create a new project from one of the templates in Builder, you’ll already have a basic GTK window example with all the buildsystem set up, so you might want to try that and edit the source files under the src directory to start coding then. Alternatively you can use a very minimal meson snippet as explained in Meson’s documentation (which uses a GTK example even ).
That’s exactly what I am saying: Builder has no way to know that your C files laying around in this folder need to be linked with gtk4 to produce an executable (it could be a library after all, but it can’t know it since you have no buildsystem). And to provide syntax highlighting and error display, it uses clang which needs to know how to build your C files, which Builder is able to provide only if there is a buildsystem it can ask those informations to (i.e. dependencies, files to build, build flags).