Bug 8 – std.boxer linker error

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2006-03-04T04:07:00Z
Last change time
2014-02-14T20:33:35Z
Keywords
link-failure
Assigned to
bugzilla
Creator
braddr

Comments

Comment #0 by braddr — 2006-03-04T04:07:38Z
On linux with dmd 0.148, I'm seeing some odd linking issues that I haven't tracked down just yet. $ cat test_box.d import std.boxer; int main() { Box foo = box(1); int bar = unbox!(int)(foo); return 0; } $ dmd -g -v test_box.d parse test_box semantic test_box semantic2 test_box semantic3 test_box code test_box generating code for function 'main' generating code for function 'unbox' generating code for function 'unboxCastInteger' gcc test_box.o -o test_box -g -lphobos -lpthread -lm -Xlinker -L/workplace/bradrob/dmd-0.148/dmd/lib test_box.o(.gnu.linkonce.t_D3std5boxer24__T16unboxCastIntegerTiZ16unboxCastIntegerFS3std5boxer3BoxZi+0x18): In function `_D3std5boxer24__T16unboxCastIntegerTiZ16unboxCastIntegerFS3std5boxer3BoxZi': /workplace/bradrob/d-playground/test_box.d:5: undefined reference to `_assert_3std5boxer' collect2: ld returned 1 exit status --- errorlevel 1 Commenting out the assert in std/boxer.d inside unboxCastInteger(T) at line 429 allows the link to succeed. Similarly, if I use something other than an int and hit one of the other unboxCast[pick a type] templates I get the same problem. ------- From Derek Parnell: On Windows, you have to compile anything that imports std.boxer with the "-release" switch to get the linker happy.
Comment #1 by sylverpyro — 2007-01-23T11:43:20Z
This issue is still present in the phobos library with dmd 1.00 (OS is linux)
Comment #2 by sean — 2007-01-23T13:10:21Z
This is related to issue 846.
Comment #3 by thomas-dloop — 2007-02-27T18:35:51Z
Fixed DMD 1.005
Comment #4 by bugzilla — 2007-07-07T22:48:31Z
Appears to work fine now.