[fpc-pascal] Linking generics with long names with STABS gives Undefined Symbol

cobines cobines at gmail.com
Thu Aug 11 04:47:01 CEST 2011


Hello.

I have the following program:

program atest;

{$mode objfpc}{$H+}

uses
  Classes, SysUtils, fgl;

type
  TMyClass = class end;
  TControlObjectSpecializedWithAVeryLongNameOfClass = class end;

  {$IFDEF USELONGNAME}
  TMyType = TControlObjectSpecializedWithAVeryLongNameOfClass;  // Error
  {$ELSE}
  TMyType = TMyClass; // OK
  {$ENDIF}

  TSpecControlInfo = specialize TFPGList<TMyType>;

begin
end.


If I build with:
$ fpc -dUSELONGNAME -gs atest.pas

Target OS: Win32 for i386
Compiling atest.pas
Linking atest.exe
atest.pas(36,1) Error: Undefined symbol:
VMT_P$ATEST_TBASECONTROLINFO$TOBJECTINFO$TVERYLONGNAMEOFCLASS_$_TFPGOBJECTLIST$TOBJECTINFO$TVERYLONGNAMEOFCLASS_$__TFPGLISTENUMERATOR$TOBJE
atest.pas(36,1) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted

If I omit either "-dUSELONGNAME" or "-gs", or use dwarf debugging info
then linking is successful.

Is this some limitation of STABS or a bug?
My platform is Windows XP SP3 i386. FPC 2.7.1 r18142.

--
cobines



More information about the fpc-pascal mailing list