www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Error 42: Symbol Undefined __d_throwc

reply "Tyro[a.c.edwards]" <nospam home.com> writes:
The following:

import std.regex;

void main()
{
	string s = "$,";
	replace(s, regex("$",","), ""); // Is this possible?  If so, what is 
the propper way to do it?
	assert(s == "", s);
}

Compiled with dmd.2.039, 042, 048, and 049 but yields a runtime error:
D:\code>bug
object.Exception: unrecognized attribute

Compiled with dmd.2.050, it yields the linker error:
D:\code>dmd bug
OPTLINK (R) for Win32  Release 8.00.8
Copyright (C) Digital Mars 1989-2010  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
bug.obj(bug)
  Error 42: Symbol Undefined __d_throwc
--- errorlevel 1

I grepped my hard drive for _d_throwc and found the following:
D:\code>grep -r -i _d_throwc d:\*.*
\dmd2\linux\lib\libphobos2.a:_d_throwc
\dmd2\linux\lib\libphobos2.a:.text._d_throwc
\dmd2\linux\lib\libphobos2.a:.rel.text._d_throwc
\dmd2\osx\lib\libphobos2.a:__d_throwc
\dmd2\src\dmd\dmd.exe:_d_throwc
\dmd2\src\dmd\rtlsym.obj:_d_throwc
\dmd2\src\dmd\backend\rtlsym.h:SYMBOL_MARS(THROWC,          FLfunc,(mES 
| mBP),"_d_throwc", SFLexit, t) \
\dmd2\src\druntime\deh.obj:__d_throwc..
\dmd2\src\druntime\lib\druntime.lib:__d_throwc..
\dmd2\src\druntime\lib\druntime.lib:__d_throwc.
\dmd2\src\druntime\src\rt\deh.c:void _d_throwc(Object *h)
\dmd2\src\druntime\src\rt\deh2.d:extern (C) void _d_throwc(Object *h)
\dmd2\src\phobos\phobos.lib:__d_throwc..
\dmd2\windows\bin\dmd.exe:_d_throwc

Redundant entries were removed for brevity.

Function _d_throwc is defined on line 152 of 
dmd2\src\druntime\src\rt\deh2.d and line 232 of 
dmd2\src\druntime\src\rt\deh.d. I do not know how to correct the problem 
however it does seem odd that Linux's libphobos2.a uses the same name as 
was originally defined "_d_throwc" while OSX's libphobos2.a, 
druntime.lib and phobos.lib are different. Note that this function did 
not exist prior to dmd.2.050. Don't know if it matters but I'm using 
Win7. Any assistance is appreciated.

Andrew
Nov 19 2010
parent reply Jimmy Cao <jcao219 gmail.com> writes:
I can't reproduce it on Windows 7 with dmd 2.050.

On Sat, Nov 20, 2010 at 12:45 AM, Tyro[a.c.edwards] <nospam home.com> wrote:

 The following:

 import std.regex;

 void main()
 {
        string s = "$,";
        replace(s, regex("$",","), ""); // Is this possible?  If so, what is
 the propper way to do it?
        assert(s == "", s);
 }

 Compiled with dmd.2.039, 042, 048, and 049 but yields a runtime error:
 D:\code>bug
 object.Exception: unrecognized attribute

 Compiled with dmd.2.050, it yields the linker error:
 D:\code>dmd bug
 OPTLINK (R) for Win32  Release 8.00.8
 Copyright (C) Digital Mars 1989-2010  All rights reserved.
 http://www.digitalmars.com/ctg/optlink.html
 bug.obj(bug)
  Error 42: Symbol Undefined __d_throwc
 --- errorlevel 1

 I grepped my hard drive for _d_throwc and found the following:
 D:\code>grep -r -i _d_throwc d:\*.*
 \dmd2\linux\lib\libphobos2.a:_d_throwc
 \dmd2\linux\lib\libphobos2.a:.text._d_throwc
 \dmd2\linux\lib\libphobos2.a:.rel.text._d_throwc
 \dmd2\osx\lib\libphobos2.a:__d_throwc
 \dmd2\src\dmd\dmd.exe:_d_throwc
 \dmd2\src\dmd\rtlsym.obj:_d_throwc
 \dmd2\src\dmd\backend\rtlsym.h:SYMBOL_MARS(THROWC,          FLfunc,(mES |
 mBP),"_d_throwc", SFLexit, t) \
 \dmd2\src\druntime\deh.obj:__d_throwc..
 \dmd2\src\druntime\lib\druntime.lib:__d_throwc..
 \dmd2\src\druntime\lib\druntime.lib:__d_throwc.
 \dmd2\src\druntime\src\rt\deh.c:void _d_throwc(Object *h)
 \dmd2\src\druntime\src\rt\deh2.d:extern (C) void _d_throwc(Object *h)
 \dmd2\src\phobos\phobos.lib:__d_throwc..
 \dmd2\windows\bin\dmd.exe:_d_throwc

 Redundant entries were removed for brevity.

 Function _d_throwc is defined on line 152 of
 dmd2\src\druntime\src\rt\deh2.d and line 232 of
 dmd2\src\druntime\src\rt\deh.d. I do not know how to correct the problem
 however it does seem odd that Linux's libphobos2.a uses the same name as was
 originally defined "_d_throwc" while OSX's libphobos2.a, druntime.lib and
 phobos.lib are different. Note that this function did not exist prior to
 dmd.2.050. Don't know if it matters but I'm using Win7. Any assistance is
 appreciated.

 Andrew
Nov 20 2010
parent "Tyro[a.c.edwards]" <nospam home.com> writes:
On 11/21/2010 1:13 AM, Jimmy Cao wrote:
 I can't reproduce it on Windows 7 with dmd 2.050.

 On Sat, Nov 20, 2010 at 12:45 AM, Tyro[a.c.edwards] <nospam home.com
 <mailto:nospam home.com>> wrote:

     The following:

     import std.regex;

     void main()
     {
             string s = "$,";
             replace(s, regex("$",","), ""); // Is this possible?  If so,
     what is the propper way to do it?
             assert(s == "", s);
     }

     Compiled with dmd.2.039, 042, 048, and 049 but yields a runtime error:
     D:\code>bug
     object.Exception: unrecognized attribute
That bit of info actually fixed linker error portion of my problem. Seems my copy of dmd 2.050 got corrupted. Trying to run the program still results in the runtime error above. Any ideas? Thanks, Andrew
Nov 20 2010