【问题标题】:How to install jpeglib on Windows 10如何在 Windows 10 上安装 jpeglib
【发布时间】:2016-11-09 10:17:31
【问题描述】:

我使用的是 64 位 Windows 10 操作系统。我从 JPEG 网站下载了 jpegsr9b 库,用于读取 JPEG 头文件。我用 C 编写了程序来读取 JPEG 文件,如下所示:

#include<stdio.h>
#include<jpeglib.h>
#include <stdlib.h>

int main()
{

struct jpeg_decompress_struct cinfo;

 struct jpeg_error_mgr jerr;

int height,width,pixel_size,colorspace,i,j,k,res;

FILE *infile = fopen("e:/Images/im.jpg", "rb");
cinfo.err = jpeg_std_error(&jerr);

jpeg_create_decompress(&cinfo);
jpeg_stdio_src(&cinfo, infile);
jpeg_read_header(&cinfo, TRUE);
jpeg_start_decompress(&cinfo);
width = cinfo.output_width;
height = cinfo.output_height;

printf("\nWidth = %d",width);
printf("\nHeight = %d",height);
}

然后编译为

gcc demo.c -ljpeg

但它给出了错误

在 demo.c:2:0 包含的文件中: jpeglib.h:25:62:致命错误:jconfig.h:没有这样的文件或目录 编译终止。

如何解决问题?

【问题讨论】:

  • 在与您放置&lt;jpeglib.h&gt; 相同的位置,您必须安装jpeg lib 的所有其他头文件。您必须将此路径添加到您的包含 [环境] 变量/makefile。编译器/链接器还必须知道在哪里可以找到 jpeg.lib。

标签: c++ c windows


【解决方案1】:

here 安装二进制文件,然后在 Visual Studio 中包含安装中的包含文件夹。

更多说明请关注answer

【讨论】:

  • 这是一个旧版本,它不适用于那些想将它与 dlib 库一起使用的人。
  • "在 Visual Studio 中包含安装中的包含文件夹" 你能详细说明吗?
猜你喜欢
  • 2019-12-06
  • 2020-02-16
  • 2020-01-27
  • 2016-05-03
  • 2020-12-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多