Re: different struct sizes
- From: "Nagaraj L" <nagarajl@xxxxxxxxx>
- Date: 5 Nov 2006 21:11:38 -0800
You are using a library compiled on a platform other than what you are
using. You require libraries compiled for your platform (Same Hardware
and compiler options).
Certain platforms use 4 bytes memory for "char" and "short int"
variables. when you use 1 byte for char and 2 byte for short int on
your platform, this kind of problems are reported.
Regards,
Nagaraj L
On Nov 6, 6:58 am, Borked Pseudo Mailed <nob...@xxxxxxxxxxxxxxxxx>
wrote:
I have this weird problem with the JPEG library that I am using. There
is a function that is being called and one of the parameters being
passed is the length of a structure. Inside this function, the length
of the structure being passed is compared to the length of the same
structure calculated inside the function. Now because these values do
not match, the program exits.
======================
This is the prototype for this function:
jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, q(size_t) sizeof(struct
jpeg_decompress_struct));
======================
Now this is a portion of this function's code:
GLOBAL(void) jpeg_CreateDecompress (j_decompress_ptr cinfo, int version,
size_t structsize)
{
int i;
/* Guard against version mismatches between library and caller. */
cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called
*/
if (version != JPEG_LIB_VERSION)
ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);
if (structsize != SIZEOF(struct jpeg_decompress_struct))
ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,(int) SIZEOF(struct
jpeg_decompress_struct), (int) structsize);
======================
This is the error produced by this function:
JPEG parameter struct mismatch: library thinks size is 452, caller
expects 404
======================
Would anyone have any idea as to why something like this would happen?
Thanks
Reply
.
- Follow-Ups:
- Re: different struct sizes
- From: Christopher Benson-Manica
- Re: different struct sizes
- References:
- different struct sizes
- From: Borked Pseudo Mailed
- different struct sizes
- Prev by Date: Need some information in output of objdump
- Next by Date: Where did my pointers go?
- Previous by thread: Re: different struct sizes
- Next by thread: Re: different struct sizes
- Index(es):
Relevant Pages
|