【问题标题】:Installed GTK+ with homebrew, but pkg_check_modules doesn't recognize it用自制软件安装了 GTK+,但 pkg_check_modules 无法识别它
【发布时间】:2014-09-24 03:42:29
【问题描述】:

我正在尝试编译一个开源 repo,它需要 CMakeLists.txt 文件中的 gtk+:

pkg_check_modules (GTK     REQUIRED gtk+-2.0>=2.12)

所以我用自制软件安装了 gtk+-2.0:

~  brew install gtk
Warning: gtk+-2.24.23 already installed

为了确保pkg-config 能够识别它,我已经尝试过:

~  pkg-config --modversion gtk+-2.0
2.24.23

这是完全正确的,但是当我使用ccmake .. 配置项目时,我得到了错误:

CMake Error at /usr/local/Cellar/cmake/2.8.12.2/share/cmake/Modules/FindPkgConfig.cmake:279 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/2.8.12.2/share/cmake/Modules/FindPkgConfig.cmake:333 (_pkg_check_modules_internal)
  CMakeLists.txt:194 (pkg_check_modules)

我该如何解决这个问题?

【问题讨论】:

    标签: c++ c cmake homebrew pkg-config


    【解决方案1】:

    你试过了吗

    export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig:$PKG_CONFIG_PATH

    export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"

    来自https://github.com/naxuroqa/Venom/issues/4#issuecomment-27215983

    【讨论】:

      【解决方案2】:

      您所要做的就是安装 pkg-config :

      brew install pkg-config
      

      【讨论】:

        猜你喜欢
        • 2020-09-02
        • 1970-01-01
        • 2021-11-19
        • 2014-07-14
        • 1970-01-01
        • 1970-01-01
        • 2022-09-16
        • 2022-12-16
        相关资源
        最近更新 更多