Pier Nardin
Pier Nardin

Reputation: 41

Unresolved external linker error in C++Builder

I am new to C++ Builder. I am translating a Delphi project into C++. I have translated some of the Delphi code into C++ and it compiles fine in C++Builder, but I get an error:

Unresolved external ColorClasses::TColorList:: referenced from ...

when I use the TColorList constructor in my MainForm in this way:

ColorClasses::TColorList *cl;

cl = new ColorClasses::TColorList();

The TColorList constructor is defined as follows in file ColorClasses.cpp:

__fastcall ColorClasses::TColorList::TColorList() : TColorClass()
{
  fcolor_list = new TList();
}

The TColorList class is declared as follows in file ColorClasses.h:

class DELPHICLASS TColorList;

class PASCALIMPLEMENTATION TColorList : public TColorClass
{
private:
  TList* fcolor_list;

public:
  __fastcall TColorList();
  virtual __fastcall ~TColorList();
};

I have searched the StackOverflow site for similar questions relevant to C++Builder, but I can't find one specific to my problem.

Upvotes: 0

Views: 343

Answers (1)

Pier Nardin
Pier Nardin

Reputation: 41

The problem seems to resolve itself if I remove the keywords DELPHICLASS and PASCALIMPLEMENTATION.

Upvotes: 2

Related Questions