Borland C++ Builder Linker error tip

Posted by Tim on June 5th, 2005

Borland C++ Builder Tip:

If you are getting a linker error when compiling, and everything makes sense, try this.
Recently I was compiling after adding a new unit. I was package exporting the unit
i.e.
class PACKAGE TMyClass;

and when I would remove the package export, it would link up just fine.

The problem turned out to be a missing #pragma directive in the unit.

The exact line I needed is:
#pragma package(smart_init)

If you found this while searching for a solution to your problem, please leave a comment.