using jpeg-6b, error error: too many arguments to function ‘void jpeg_CreateDecompress()’

609 views Asked by At

Our code uses jpeg libraries and worked in older configurations but recently I've been trying to make it work with a local jpeg-6b package and am getting this error, "too many arguments to function 'void jpeg_CreateDecompress()". I made a simple application to demonstrate:

#include <sys/types.h>
#include "jpeg-6b/jpeglib.h"
main()
{
    struct jpeg_decompress_struct cinfo;

    jpeg_create_decompress(&cinfo);
}

And compiling gets this:

gcc jtest.cpp -Ijpeg-6b -Ljpeg-6b -ljpeg
In file included from jtest.cpp:2:0:
jtest.cpp: In function ‘int main()’:
jpeg-6b/jpeglib.h:899:52: error: too many arguments to function ‘void jpeg_CreateDecompress()’
      (size_t) sizeof(struct jpeg_decompress_struct))
                                                    ^
jtest.cpp:7:5: note: in expansion of macro ‘jpeg_create_decompress’
     jpeg_create_decompress(&cinfo);
     ^
jpeg-6b/jpeglib.h:902:14: note: declared here
 EXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo,

In jpeglib.h, jpeg_create_decompress is a macro that takes one argument and expands to jpeg_CreateDecompress which has 3 arguments, using the cinfo as the first argument and filling in the other two. Looks to me like the argument counts are correct:

#define jpeg_create_decompress(cinfo) \
    jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \
                          (size_t) sizeof(struct jpeg_decompress_struct))
EXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo,
                                      int version, size_t structsize));
EXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo,
                                        int version, size_t structsize));

This is just jpeg-6b as downloaded off google, configured via "configure" before running "make libjpeg.a. I haven't changed any of the jpeg-6b source code. Probably something stupid but any ideas?

This is on Ubuntu 14.04.1.

0

There are 0 answers