I am having 64 bit Windows 10 operating system. I have downloaded jpegsr9b
library from JPEG website which is used for reading JPEG header file. I have written program in C to read JPEG file as below:
#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);
}
Then compiled as
gcc demo.c -ljpeg
But it gives error
In file included from demo.c:2:0: jpeglib.h:25:62: fatal error: jconfig.h: No such file or directory compilation terminated.
How to solve the problem?