I already asked this question at apple.stackexchange.com, but I was told it was the wrong place for this question - so I will ask it here, as I was suggested to do.
At my university we got the task to implement a c-program which has a GTK-GUI. The GTK-GUI is already implemented, we just have to implement a algorithm which hands it some data.
I already got gcc/g++ working. But when i try to compile the project the compiler returns the error, that it does not find the gtk:
fatal error: 'gtk/gtk.h' file not found #include <gtk/gtk.h> ^
So my question is: How do I install gtk on OSX Mavericks for using it with gcc/g++ compiler?
My setup: MacBook Pro Retina Mid 2012 with OSX Mavericks. Homebrew is installed and working if it could be useful for the installation.
(Of course the Apple Command Line Developer Tools are installed)
Gtk is a unix graphical framework originally designed to run on Unix systems with X-Windows... but it provides multiple backends including one for MacOS's Quartz graphics engine, so it can be built to run on MacOS without enabling the X11 subsystem.
I finally solved the Problem. tojanfoe suggested in a comment the link http://www.hardcoded.net/devlogs/20120426 which turned out to not be helpful.
This is how i solved it:
1.a) Installation of GTK+ 2.x:
brew install gtk+
1.b) Installation of GTK+ 3.x:
You can install gtk+ 3.x via home brew too if you need that, but the 2.x version is enough for my purposes. The command would be:
brew install gtk+3
2.) But after the installation I had the problem, that cairo could not be found. So i solved it this way:
export PKG_CONFIG_PATH=/usr/local/Cellar/cairo/1.12.16/lib/pkgconfig/
3.) Then the compiler said it could not find the package 'xcb-shm', required by 'cairo'. This can be solved this way:
export PKG_CONFIG_PATH=/usr/X11/lib/pkgconfig
After this command the compiler worked as expected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With