1 2 3 4 5 6 |
Linux servername 5.8.0-59-generic #66~20.04.1-Ubuntu SMP Thu Jun 17 11:14:10 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux LSB Version: core-11.1.0ubuntu2-noarch:printing-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch Distributor ID: Ubuntu Description: Ubuntu 20.04.2 LTS Release: 20.04 Codename: focal |
settings.json:
1 2 3 |
// C, C++ "editor.formatOnSave": true, "C_Cpp.clang_format_style": "{BasedOnStyle: WebKit, UseTab: Always, IndentWidth: 4, TabWidth: 4}", |
project/.vscode/settings.json:
1 2 3 4 5 6 7 8 |
{ "files.associations": { "stdio.h": "c", "gtk.h": "c", "cerrno": "c", "optional": "c" } } |
project/.vscode/c_cpp_properties.json:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
{ "configurations": [ { "name": "Linux", "includePath": [ "${workspaceFolder}/**", "/usr/include/**", "/usr/include/gtk-3.0", "/usr/include/glib-2.0", "/usr/lib/x86_64-linux-gnu/glib-2.0/include", "/usr/include/pango-1.0", "/usr/include/harfbuzz", "/usr/include/cairo", "/usr/include/gdk-pixbuf-2.0", "/usr/include/atk-1.0" ], "defines": [], "compilerPath": "/usr/bin/gcc", "cStandard": "gnu17", "cppStandard": "gnu++14", "intelliSenseMode": "linux-gcc-x64" } ], "version": 4 } |
Install, compile and run:
1 2 3 4 |
$ sudo apt install libgtk-3-dev $ sudo apt install libglib2.0-dev $ gcc program.c -o program `pkg-config --cflags --libs gtk+-3.0` $ G_MESSAGES_DEBUG=all ./program |