我试图建立一个可以与Open Scene Graph(OSG)一起使用的环境,但是我的第三方库有问题。它是使用cmake构建的,但是当我运行它时,会出现多个错误,如下所示:

Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)


如下所示的线程说这是因为未安装库或cmake找不到它们。

cmake error when configuring

如果只缺少一个库,那很好,但是我有14个库的问题。我正在尝试使用apt-get,然后在.profile文件中输入lib目录,以便cmake可以找到它们。这似乎需要整天才能正确。我是C,C ++和Linux的新手(只需设置我的第一个Ubuntu环境)。在Java中,我可以使用Maven之类的方法来解决此问题。在这种情况下,我可以使用任何类似方法吗?

我已经从github上获取了源代码,并且正在按照他们的指示进行构建。 https://github.com/openscenegraph/OpenSceneGraph

完整的输出:

$ cmake .

Could NOT find EGL (missing:  EGL_LIBRARY EGL_INCLUDE_DIR)
Could NOT find Freetype (missing:  FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS)
Could NOT find JPEG (missing:  JPEG_LIBRARY JPEG_INCLUDE_DIR)
Could NOT find Jasper (missing:  JASPER_LIBRARIES JASPER_INCLUDE_DIR JPEG_LIBRARIES)
Could NOT find LibXml2 (missing:  LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
Could NOT find ZLIB (missing:  ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
Could NOT find ZLIB (missing:  ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
Could NOT find GDAL (missing:  GDAL_LIBRARY GDAL_INCLUDE_DIR)
Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)
Could NOT find CURL (missing:  CURL_LIBRARY CURL_INCLUDE_DIR)
Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)
Could NOT find GStreamer (missing:  GSTREAMER_INCLUDE_DIRS GSTREAMER_LIBRARIES GSTREAMER_VERSION GSTREAMER_BASE_INCLUDE_DIRS GSTREAMER_BASE_LIBRARIES GSTREAMER_APP_INCLUDE_DIRS GSTREAMER_APP_LIBRARIES GSTREAMER_PBUTILS_INCLUDE_DIRS GSTREAMER_PBUTILS_LIBRARIES)
Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)
Could NOT find SDL2 (missing:  SDL2_LIBRARY SDL2_INCLUDE_DIR)
Could NOT find SDL (missing:  SDL_LIBRARY SDL_INCLUDE_DIR)
Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)
Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)
Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)
Could NOT find JPEG (missing:  JPEG_LIBRARY JPEG_INCLUDE_DIR)
Could NOT find ZLIB (missing:  ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
Could NOT find PNG (missing:  PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
Could NOT find TIFF (missing:  TIFF_LIBRARY TIFF_INCLUDE_DIR)
g++ version 5.4.0
Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)
Configuring done
Generating done

最佳答案

通常,您会apt-get install openscenegraph。您有理由不能这样做吗?

https://packages.debian.org/jessie/openscenegraph是debian下软件包的名称。根据使用的发行版,您使用本页上列出的要求的条件可能很相似(如果不一致)(另请参见:https://packages.debian.org/jessie/libopenscenegraph-dev

请注意,您尝试编译的openscenegraph可能提供了openthreads

09-16 04:17