2

What __tpdsc__ means in the C++ compilation error messages? For example:

[ilink32 Error] Error: Unresolved external '__tpdsc__ ELicense' referenced from LICENSE.OBJ

I am using CLANG as C++ compiler.

I am asking what tpdsc means, not what "unresolved external" means since it is clear. tpdsc is something that the compiler adds and I would like to know what it means.

My code is:

  class PACKAGE ELicense: public Exception
  {
     public:
        ELicense(int code);
        virtual __fastcall ~ELicense();
     private:
        int Code;
        String CodeToMessage(int code);

   };

tpdsc word is not used in the source however CLANG shows tpdsc before the ELicense class name. I am trying to figure out what it means. Then I expect to understand about what the compiler is complaining since the error message shows only the class name, not the function name. Also, I have double checked that all functions are implemented correctly in the cpp file.

VLL
  • 9,634
  • 1
  • 29
  • 54
kokokok
  • 1,030
  • 1
  • 9
  • 26
  • nice, 5s to close question :-) – marcinj Aug 12 '16 at 16:39
  • @mrtnj Don't you have a fav list with these links? :) – πάντα ῥεῖ Aug 12 '16 at 16:41
  • @OP _"since it is clear. tpdsc is something that the compiler adds"_ Sure? Does it happen with a _Hello World_ program? You are missing to give us enough information for getting a better answer. – πάντα ῥεῖ Aug 12 '16 at 17:05
  • It's not an exact duplicate. `ELicense` is the unresolved symbol. `__tpdsc__` is likely some kind of CLang symbol decorator or type designator. Google provides no information on it. I too would like to know what it means. – davidbak Aug 12 '16 at 17:06
  • @kokokok a) are you compiling for 32-bit or 64-bit? b) What happens if you remove `__fastcall__` from the destructor declaration? c) What is the definition of the symbol `PACKAGE`? d) Does the destructor declaration _exactly_ match the declaration of `Exception::~Exception`? – davidbak Aug 12 '16 at 17:12
  • 32 bits. I have deleted the desctructor and same error. – kokokok Aug 12 '16 at 17:14
  • @kokokok what do you mean with `deleted the destructor`? As in just set to `=delete` in the derived class or in the base-class as well? (edit: oh, sorry didn't see this was necro'd) – PeterT Mar 19 '19 at 15:26
  • The fastcall convention is poorly standardized. Clang normally uses two registers (ecx and edx) but Borland used 3 (also eax). So you are surely seeing the attribute that says "Borland convention". With the advantage that you'd get a linker error when modules disagree. The "tp" could mean turbo pascal, the first Borland product that used fastcall, that's a guess. – Hans Passant Mar 19 '19 at 15:37

1 Answers1

0

__tpdsc__ seems to refer to the destructor of the class. If you are using the default destructor or implementing the destructor in the a header file, you can make this error go away by implementing the problematic destructor in a cpp file.

Since you already have the destructor implemented, problem might be that it is both virtual and __fastcall, but I don't know which one is correct in your case.

VLL
  • 9,634
  • 1
  • 29
  • 54