0

Might be a dumb question, but how to use GTK+ (or its language bindings) with CodeBlocks in Windows? Official site gtk.org shows downloading after installing msys2, via pacman. After doing that and adding C://msys64/mingw64/bin to variable path the CodeBlocks still doesn't "see" gtk header files in include since they're in gtk-3.0/gtk/ instead of gtk/. I thought to myself that I should move files one dir up, but then after finding gtk header files, CodeBlocks is unable to find its dependencies (since they are also in some gdk-pixbuf-2.0/gdk-pixbuf instead of gdk-pixbuf/).

I was able to find gtk-bundle in some third party site, which contains all needed files and headers. After extracting them into C://gtk/ and adding it to variable path I was able to get started with gtk. However after trying to get gtkmm (C++ binding for gtk) I've ran into same problem, install only via msys2, but unfortunately no bundle archive could be found.

Any help regarding how to use libraries installed via msys2 properly would be great. Thanks in advance.

liberforce
  • 11,189
  • 37
  • 48
  • Possible duplicate of [Installing GTK for use in Code::Blocks on Windows 10](https://stackoverflow.com/questions/49786714/installing-gtk-for-use-in-codeblocks-on-windows-10) – liberforce Apr 18 '18 at 10:33

1 Answers1

1

For further usage. So after long searches and tries I've found a solution to my problem.

After installing GTK+ (or any of language bindings) via msys2 what you need to do is to use 'pkg-config gtk+-3.0 --cflags --libs > link.txt' in cmd (first cd to convenient location), this will generate .txt file with linker settings. Copy all content to CodeBlocks > linker settings. And that's where the boring part comes in. In order for CB to find all headers and dependencies, need to add all folders listed in .txt file needs to be added to CB > Search Directories.

These were the steps that allowed me to compile GTK+ and gtkmm wit CodeBlocks.