Hi Max, that's what I thought it would be. My problem though, is that I'm not quite sure what I should be looking for to find the correct #pragma or declaration (heck, I hadn't even heard of #pragmas!). I will keep looking, but if anyone can remember the correct directive then please let me know :)
Thanks, Phil. ----- Original Message ----- From: "Max Nilson" <[EMAIL PROTECTED]> To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]> Sent: Tuesday, January 07, 2003 10:12 AM Subject: RE: [DUG]: C++ Name mangling > Phil Middlemiss asks: > > > The header file for the lib has this declaration: > > extern int __cdecl mobileCreateConnection(LPTHIS_CONNECTION connection); > > > and if I call mobileCreateConnection in my code then, when compiling, > > I get the error: > > [LinkerError] Unresolved external '_mobileCreateConnection' referenced > > from c:\APath\TheCallingUnit.OBJ > > > I'm sure this is a simple matter for anyone who has used C++ Builder and > > had to link to older lib files. Can anyone help? > > This is an old and horry problem with C comiplers and linkers. The Borland > C++ is automatically assuming that any external reference is to have an > underscore prepended, while the MS library file was built without that > turned on. > > I suggest figuring out what #pragma or declaration can be used to create an > external reference from Borland C++ that doesn't have the underscore > prepended. It is in their, and I have used it many years ago, but my brin is > now too old and worn to remember. > > Worst case you can create a small assembler stub function that calls the > name sans underscore and exposes it self with a name with the underscore so > that BC++ can link to it. I've done that in my time as well. > > Cheers, Max. > > -------------------------------------------------------------------------- - > New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] > Website: http://www.delphi.org.nz > To UnSub, send email to: [EMAIL PROTECTED] > with body of "unsubscribe delphi" > Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/ > --------------------------------------------------------------------------- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi" Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/