I was recently trying to update my game to store graphics in compressed formats (JPEG and PNG).
Whilst I ended up settling on a different library, my initial attempt
I've just encountered the same problem (although I was trying to encode an image). Apparently, FILE* are not portable between DLLs so you can't use any libjpeg API that takes a FILE* as a parameter.
There are several solutions, but they all come down to having to rebuild the library: