Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / May 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
noleander - 10 May 2005 19:18 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
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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.