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:
--0016367fb7eb5f5c1d04957e4e50
Content-Type: text/plain; charset=ISO-8859-1

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

--0016367fb7eb5f5c1d04957e4e50 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I can&#39;t reproduce it on Windows 7 with dmd 2.050.<div><br><div class=3D= "gmail_quote">On Sat, Nov 20, 2010 at 12:45 AM, Tyro[a.c.edwards] <span dir= =3D"ltr">&lt;<a href=3D"mailto:nospam home.com">nospam home.com</a>&gt;</sp= an> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex;">The following:<br> <br> import std.regex;<br> <br> void main()<br> {<br> =A0 =A0 =A0 =A0string s =3D &quot;$,&quot;;<br> =A0 =A0 =A0 =A0replace(s, regex(&quot;$&quot;,&quot;,&quot;), &quot;&quot;= ); // Is this possible? =A0If so, what is the propper way to do it?<br> =A0 =A0 =A0 =A0assert(s =3D=3D &quot;&quot;, s);<br> }<br> <br> Compiled with dmd.2.039, 042, 048, and 049 but yields a runtime error:<br> D:\code&gt;bug<br> object.Exception: unrecognized attribute<br> <br> Compiled with dmd.2.050, it yields the linker error:<br> D:\code&gt;dmd bug<br> OPTLINK (R) for Win32 =A0Release 8.00.8<br> Copyright (C) Digital Mars 1989-2010 =A0All rights reserved.<br> <a href=3D"http://www.digitalmars.com/ctg/optlink.html" target=3D"_blank">h= ttp://www.digitalmars.com/ctg/optlink.html</a><br> bug.obj(bug)<br> =A0Error 42: Symbol Undefined __d_throwc<br> --- errorlevel 1<br> <br> I grepped my hard drive for _d_throwc and found the following:<br> D:\code&gt;grep -r -i _d_throwc d:\*.*<br> \dmd2\linux\lib\libphobos2.a:_d_throwc<br> \dmd2\linux\lib\libphobos2.a:.text._d_throwc<br> \dmd2\linux\lib\libphobos2.a:.rel.text._d_throwc<br> \dmd2\osx\lib\libphobos2.a:__d_throwc<br> \dmd2\src\dmd\dmd.exe:_d_throwc<br> \dmd2\src\dmd\rtlsym.obj:_d_throwc<br> \dmd2\src\dmd\backend\rtlsym.h:SYMBOL_MARS(THROWC, =A0 =A0 =A0 =A0 =A0FLfun= c,(mES | mBP),&quot;_d_throwc&quot;, SFLexit, t) \<br> \dmd2\src\druntime\deh.obj:__d_throwc..<br> \dmd2\src\druntime\lib\druntime.lib:__d_throwc..<br> \dmd2\src\druntime\lib\druntime.lib:__d_throwc.<br> \dmd2\src\druntime\src\rt\deh.c:void _d_throwc(Object *h)<br> \dmd2\src\druntime\src\rt\deh2.d:extern (C) void _d_throwc(Object *h)<br> \dmd2\src\phobos\phobos.lib:__d_throwc..<br> \dmd2\windows\bin\dmd.exe:_d_throwc<br> <br> Redundant entries were removed for brevity.<br> <br> 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 corr= ect the problem however it does seem odd that Linux&#39;s libphobos2.a uses= the same name as was originally defined &quot;_d_throwc&quot; while OSX&#3= 9;s libphobos2.a, druntime.lib and phobos.lib are different. Note that this= function did not exist prior to dmd.2.050. Don&#39;t know if it matters bu= t I&#39;m using Win7. Any assistance is appreciated.<br> <br> Andrew<br> </blockquote></div><br></div> --0016367fb7eb5f5c1d04957e4e50--
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