【发布时间】:2016-08-02 19:51:09
【问题描述】:
我用 C 语言编写了一个程序来读取 JPEG 文件,如下所示
#include<stdio.h>
#include<jpeglib.h>
#include <stdlib.h>
#include <string.h>
int main()
{
struct jpeg_decompress_struct cinfo;
struct jpeg_error_mgr jerr;
int height,width,pixel_size;
FILE *infile = fopen("/home/dbsl/Desktop/Anu/index.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;
pixel_size = cinfo.output_components;
printf("Width = %d",width);
printf("height = %d",height);
return(1);
}
程序在Fedora20上编译成功。但是当运行执行文件时,它会给出以下错误:
./a.out:加载共享库时出错:libjpeg.so.9:无法打开共享对象文件:没有这样的文件或目录
我不明白是什么问题。
【问题讨论】:
-
No such file or directory你不明白哪一部分?
标签: c header height width jpeg