Daniel Marschall
Daniel Marschall

Reputation: 3869

Include Delphi BPL in C++ Builder project

I have code in a Delphi BPL and want to use it in C++ Builder. However, it doesn't work for me.

Here is what I have done:

(1) The Delphi BPL package:

package PackageNameHere;

{$R *.res}
{$ALIGN 8}
{$ASSERTIONS ON}
{$BOOLEVAL OFF}
{$DEBUGINFO ON}
{$EXTENDEDSYNTAX ON}
{$IMPORTEDDATA ON}
{$IOCHECKS ON}
{$LOCALSYMBOLS ON}
{$LONGSTRINGS ON}
{$OPENSTRINGS ON}
{$OPTIMIZATION ON}
{$OVERFLOWCHECKS ON}
{$RANGECHECKS ON}
{$REFERENCEINFO OFF}
{$SAFEDIVIDE OFF}
{$STACKFRAMES OFF}
{$TYPEDADDRESS OFF}
{$VARSTRINGCHECKS ON}
{$WRITEABLECONST OFF}
{$MINENUMSIZE 1}
{$IMAGEBASE $400000}
{$DESCRIPTION '...'}
{$IMPLICITBUILD OFF}

.........
contains
  hcg_employeeAuth in 'Src\hcg_employeeAuth.pas';

(2) In the package options, I have enabled "Create all C++ Builder files"

(3) In the C++ Builder form, where the code should be used:

#include <vcl.h>
#pragma hdrstop
....................................
#include <hcg_employeeAuth.hpp>
#pragma package(smart_init)
#pragma resource "*.dfm"
....................................
void __fastcall TDLG_Main::FileNew1Execute(TObject *Sender)
{
  if (ThcgEmployeeAuth::Authentificate(__classid(ThcgEmployeeAuth))) {
     // ...
  }
}

(4) In the options of the C++ Builder project, I have

I get the following error message during the Linker process:

ILINK32 Error: Cannot resolve external 'Hcg_employeeAuth::ThcgEmployeeAuth::' referenced by ....\main.obj

Upvotes: 0

Views: 1324

Answers (0)

Related Questions