Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2011-08

Linking generics with long names with STABS gives Undefined Symbol

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

cobines

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

Reply by email