Boost::GIL 'jpeglib.h':没有这样的文件或目录

Boost::GIL 'jpeglib.h': No such file or directory

本文关键字:文件 jpeglib GIL Boost      更新时间:2023-10-16
#include <boost/gil/gil_all.hpp>
#include <boost/gil/extension/io/jpeg_io.hpp>
int main()
{
  using namespace boost::gil;
  rgb8_image_t img;
  jpeg_read_image("test.jpg",img);
}

我包含$BOOST_ROOT到VS 2010项目属性-> C/c++ -> General -> Additional Include Directories.

相同的错误定义在http://www.richelbilderbeek.nl/CppCompileErrorJpeglibHnoSuchFileOrDirectory.htm中但是声明的解决方案并没有解决我的问题

jpeg库可能缺失?

sudo apt-get install libjpeg-dev

sudo dnf install libjpeg-turbo-devel on fedora.

安装或绑定具有标准JPEG兼容API的库:

  • JPEG
  • JPEG-turbo
  • MozJPEG

下面是一个例子:https://github.com/ohhmm/generator/blob/741e9921c6c7083d7126fb018d941939d60a6612/picture-pattern-generate/CMakeLists.txt#L5