How to install gtk on OSX for use with g++/gcc compiler

后端 未结 2 1711
春和景丽
春和景丽 2021-01-31 10:01

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 m

2条回答
  •  有刺的猬
    2021-01-31 10:29

    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.

提交回复
热议问题