Integrating GTK+3.24.21 (Glade) libs with Codeblocks (C)

I want to integrate GTK+3.24.21 (Glade) libs with Codeblocks 17.12 for compiling of GTK+ C apps. I installed mingw64 compiler, Glade, and GKT via MSYS2 MSYS (from official website) using these commands pacman -S mingw-w64-x86_64-gtk3 pacman -S mingw-w64-x86_64-gtkmm3 pacman -S mingw-w64-x86_64-glade . I’ve tried to create GTK project through “GTK+ project” category and it failed cos I just can’t point to the right directory of GTK libs. I’ve tried this one: “C:\msys64\mingw64\include\gtk-3.0\gtk” ,but it failed cos there is no “include” folder. The only way I managed to reach the goal was to choose mingw64 as compiler and to create “Console project”, change “Build options” to the following: other compiler options - pkg-config gtk+-3.0 --cflags , other linker options - pkg-config gtk+-3.0 --libs . So now compiler is able to get libs. The result of compilation and running of the program is UI window and console behind it. So I’m looking for the way to create project through “GTK+ project” category or if the first is impossible to conceal the console window behind the main UI window.

1 Like

“GTK+ project” is very obsolete! It uses “brute force” to find libraries. But, …

  • It knows nothing about MSys2.
    • It assumes that MinGW is installed as “raw” packages in Windows.
  • It assumes that you installed GTK2!

You should keep the console in Debug builds of your project. You’ll need it while you’re developing your programs. Therefore, do this in only the Release target of the “Build options…”: Add -window to “Other linker options”.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.