Board index » cppbuilder » Using C++Builder .obj files in Delphi 3

Using C++Builder .obj files in Delphi 3

Is it possible that one can link in object (.obj) files created by C++
Builder into a Delphi 3 project. I assume one needs the {$L } compiler
option. But this gives rise to a number of unsatisfied external
declarations. Do I need to link in all of the C++ Builder object files as
well ?

Jurgen Martin
JMar...@Allstar-Software.demon.co.uk

 

Re:Using C++Builder .obj files in Delphi 3


Just redeclare the declaration in Delphi using the "external" keyword.

Alex

Re:Using C++Builder .obj files in Delphi 3


Quote
Jurgen Martin wrote:
> Is it possible that one can link in object (.obj) files created by C++
> Builder into a Delphi 3 project. I assume one needs the {$L } compiler
> option. But this gives rise to a number of unsatisfied external
> declarations. Do I need to link in all of the C++ Builder object files as
> well ?

> Jurgen Martin
> JMar...@Allstar-Software.demon.co.uk

I don't know if you'll get this problem, but I've run into C++ name-mangling
issues when linking .obj files (or .lib files, in that case, though it should
be the same) into Delphi. I didn't try too hard at the time to solve the
issue, but eventually I'll have to get around it, so let me know if you solve
the name-mangling problem (assuming it comes up for you).

--
Chris Swiedler

Process and Technology Consultants
Atlanta, GA

http://www.ptc-inc.com

Re:Using C++Builder .obj files in Delphi 3


Name mangling can be gotten rid of by putting
extern "C" {
Quote
}

 around the function whose name you don't want mangled (in the header file
of course).

Quote
> I don't know if you'll get this problem, but I've run into C++
name-mangling
> issues when linking .obj files (or .lib files, in that case, though it
should
> be the same) into Delphi. I didn't try too hard at the time to solve the
> issue, but eventually I'll have to get around it, so let me know if you
solve
> the name-mangling problem (assuming it comes up for you).

> --
> Chris Swiedler

> Process and Technology Consultants
> Atlanta, GA

> http://www.ptc-inc.com

Other Threads