jpeg_stdio_dest not being found on windows build
Moderator: Moderator Team
jpeg_stdio_dest not being found on windows build
Hi
Im building some custom code around your library. On Linux it works fine.
Under windows it doesnt call the correct jpeg_stdio_dest - when I try debug it doesnt seem to be calling anything.
Its as if it didnt see my implementation of jpeg_stdio_dest.
Why would this problem only happen on windows.
Im using visual studio C++ express 2010
Thanks and apologies if you consider this to be an IJG question.
I can reopen on their forums if you wish.
Im building some custom code around your library. On Linux it works fine.
Under windows it doesnt call the correct jpeg_stdio_dest - when I try debug it doesnt seem to be calling anything.
Its as if it didnt see my implementation of jpeg_stdio_dest.
Why would this problem only happen on windows.
Im using visual studio C++ express 2010
Thanks and apologies if you consider this to be an IJG question.
I can reopen on their forums if you wish.
-
- DCMTK Developer
- Posts: 120
- Joined: Thu, 2009-11-26, 08:15
I have a new jpeg_stdio_dest. Why? because the current one used file handles instead of streams so is very inflexible.
When I run the debugger and try to step into jpeg_stdio_dest it just jumps straight over as if the function pointer is null.
It seems that it isnt linking to the jpeg_stdio_dest and I assume the whole extern defiiniton thing isnt working in my windows build.
I can create a wrapper extern function in the same source file as jpeg_stdio_dest and that works perfectly ok!
So my destination manager now has
And the plugin now has
but nothing I can do will get it to see the jpeg_stdio_dest method - I think the definition in jpeglib8.h is messing things up somehow.
When I run the debugger and try to step into jpeg_stdio_dest it just jumps straight over as if the function pointer is null.
It seems that it isnt linking to the jpeg_stdio_dest and I assume the whole extern defiiniton thing isnt working in my windows build.
I can create a wrapper extern function in the same source file as jpeg_stdio_dest and that works perfectly ok!
So my destination manager now has
Code: Select all
GLOBAL(void)
jpeg_stdio_dest_wrapper (j_compress_ptr cinfo, FILE * outputbuffer)
{
return jpeg_stdio_dest (cinfo, outputbuffer);
}
And the plugin now has
Code: Select all
extern void jpeg_stdio_dest_wrapper (j_compress_ptr cinfo, FILE * outputbuffer);
...
int DiJPEGPluginRhapsody::write(DiImage *image,
FILE *outputbuffer,
//signed char **stream, "error: cannot declare variable ‘plugin’ to be of abstract type"
const unsigned long frame) const
{
...
#ifdef HAVE_WINDOWS_H
// get around windows linking wierdness by a simple forced hack
jpeg_stdio_dest_wrapper(&cinfo, (FILE *)outputbuffer);
#else
jpeg_stdio_dest(&cinfo, (FILE *)outputbuffer);
#endif
-
- DCMTK Developer
- Posts: 120
- Joined: Thu, 2009-11-26, 08:15
jpeglib12.h contains this:
So perhaps you missed this little magic and are calling a function that doesn't exist?
(This hack exists to make it possible for the 8bpp, 12bpp and 16bpp versions to co-exist)
Code: Select all
#define jpeg_stdio_dest jpeg12_stdio_dest
(This hack exists to make it possible for the 8bpp, 12bpp and 16bpp versions to co-exist)
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 1 guest