I’m trying to use libjasper from http://www.ece.uvic.ca/~frodo/jasper/ as a static library in compiling dcraw.c from http://www.cybercom.net/~dcoffin/dcraw/ on windows with VC9. I have resolved several issues on the way and finally get three linking errors.
1>dcraw.obj : error LNK2001: unresolved external symbol _ftello
1>dcraw.obj : error LNK2001: unresolved external symbol _fseeko
1>dcraw.obj : error LNK2001: unresolved external symbol _getc_unlocked
the first two of these are easily resolved it seems, I added
#define fseeko _fseeki64
#define ftello _ftelli64
and that does it but what about the third one:
1>dcraw.obj : error LNK2001: unresolved external symbol _getc_unlocked
How can I work around that on windows with visual studio?
Thanks.
The actual equivalent of
getc_unlockedis notgetc, it’s_fgetc_nolock. So, assuming that whoever wrote the original code knew what he’s doing and had some reasons to prefer the thread-unsafe version, you probably want this: