By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,200 Members | 1,761 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,200 IT Pros & Developers. It's quick & easy.

Name mangling causes link errors ... how disable mangling?

P: n/a
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

Nov 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"noleander" <no*******@discussions.microsoft.com> wrote in message
news:2C**********************************@microsof t.com...
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
...


Try this

extern "C"
{
#include "libjpeg.h"
};

Regards,
Will

Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.