www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1471] New: Linker error on template function. Error 42: Symbol Undefined ...

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1471

           Summary: Linker error on template function.  Error 42: Symbol
                    Undefined ...
           Product: D
           Version: 1.020
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: link-failure
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: gamerChad gmail.com


void explode(char[] foo)()
{
  int gremlins;
  char[] bar = foo[gremlins..$];
}

void main(){ explode!("BOOM"); }


The above program prints the following when compiled:

C:\dmd\bin\..\..\dm\bin\link.exe main,,,user32+kernel32/noi;
OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

main.obj(main)
 Error 42: Symbol Undefined
_D4main27__T7explodeVG4aa4_424f4f4dZ7explodeFZv8__do
llark
--- errorlevel 1



This was tested with DMD 1.020 on Windows XP.


-- 
Sep 03 2007
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1471


kennytm gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kennytm gmail.com
            Version|1.020                       |D1 & D2


--- Comment #1 from kennytm gmail.com 2011-05-08 01:09:21 PDT ---
Still not fixed in D2.052 :)

-------------------------------------
void explode(string foo)() {
  int gremlins = 0;
  string bar = foo[gremlins .. $];
}

void main(){ explode!("BOOM")(); }
-------------------------------------
Undefined symbols:
  "_D1x27__T7explodeVAyaa4_424f4f4dZ7explodeFZv8__dollark", referenced from:
      _D1x27__T7explodeVAyaa4_424f4f4dZ7explodeFZv8__dollark$non_lazy_ptr in
x.o
     (maybe you meant:
_D1x27__T7explodeVAyaa4_424f4f4dZ7explodeFZv8__dollark$non_lazy_ptr)
ld: symbol(s) not found
collect2: ld returned 1 exit status
--- errorlevel 1
-------------------------------------

'_D1x27__T7explodeVAyaa4_424f4f4dZ7explodeFZv8__dollark' means 'void
x.explode!("BOOM").explode().uint __dollar'.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 08 2011