I need to use a library supplied by someone else: libjpeg.lib. This is a
plain C library. I do not have the source code. I do have the header *.h
files. When I run dumpbin on the libjpeg.lib, it contains symbols (entry
points) like:
jpeg_read_header
I'm trying to link my program with this library. My program is in Visual
C++. The link fails with link-time errors such as:
unable to find function _cdecl_jpeg_read_header(int, char*) [more mangling
stuff]
Apparently, at compile time my compiler is mangling the library function
names (from the library header files) to include the parameter types.
To fix this, I presume, I need to put some instructions into the library's
header files that say "Treat these as normal C functions without mangling".
Any suggestions on how to make the link successful? Thanks in advance for
any help.
neal
William DePalo [MVP VC++] - 10 May 2005 21:16 GMT
>I need to use a library supplied by someone else: libjpeg.lib. This is a
> plain C library. I do not have the source code. I do have the header *.h
[quoted text clipped - 3 lines]
> jpeg_read_header
> ...
Try this
extern "C"
{
#include "libjpeg.h"
};
Regards,
Will