views:

64

answers:

1

I have a C++ Builder DLL that must link against a Delphi package (BPL), and I think it is possible that the Delphi package may need to be rebuilt to allow it to be used by both C++ Builder and Delphi, but I don't know which options need to be set on the Delphi package.

The current problem is that "UnitX.obj" is not found (ILINK32 error) when linking the C++ Builder package, and UnitX is a unit intended to be dynamically linked between C++Builder and Delphi packages.

I thought it should be enough to change the Delphi BPL project's Link options like this:

Project Options ->Delphi Compiler->Linking ->linker output : 
   "Generate all C++ Builder files (including package libs)"

The C++Builder DLL has "Runtime packages" checked, and "build with runtime packages" list is set up correctly (it contains the package that contains the UnitX.)

A: 

The problem turns out to be the search path of the linking package. It can not find the .DCP file, then it can not link. It seems to look for the DCP first, fail silently, then look for the compiled unit in question (extension .dcu) and then give the error on the DCU not the missing DCP.

The Project Options "Generate All C++ Builder Files" is enough, if your search path (dcu and dcp search, ) and include (.hpp) folders.

Warren P