digitalmars.D.bugs - (0.102) A problem with mixins and compiling to OBJ/LIB.
- Ilya Zaitseff (39/39) Oct 06 2004 A problem with mixins and compiling to OBJ/LIB.
-
Carlos Santander B.
(56/56)
Oct 06 2004
"Ilya Zaitseff"
escribió en el mensaje - Thomas Kuehne (4/28) Oct 16 2004 Can someone reproduce this bug under Linux?
A problem with mixins and compiling to OBJ/LIB.
<testmod.d>
template TFoo()
{
void foo() {}
}
struct Bar
{
mixin TFoo!();
void bar() {}
}
<testmain.d>
import testmod;
void main()
{
Bar f;
f.foo();
}
DMD -c TESTMOD.D (Step X)
LIB -c TESTMOD.LIB TESTMOD.OBJ
DMD TESTMAIN.D TESTMOD.LIB
DMD 0.102 gives link error:
testmain.obj(testmain)
Error 42: Symbol Undefined _D7testmod3Bar03fooFZv
Yeah, because foo() is not in .lst from testmod.lib (LIB -l TESTMOD.LIB):
Publics by name module
__init_7testmod3Bar testmod
_array_7testmod testmod
_assert_7testmod testmod
_D7testmod3Bar3barFZv testmod
But, if we do (Step X) with DMD 0.101, all works perfect, and .lst is:
Publics by name module
__init_7testmod3Bar testmod
_array_7testmod testmod
_assert_7testmod testmod
_D7testmod3Bar03fooFZv testmod
_D7testmod3Bar3barFZv testmod
--
îÁÐÉÓÁÎÏ × ÐÏÞÔÏ×ÏÍ ËÌÉÅÎÔÅ ÂÒÁÕÚÅÒÁ Opera: http://www.opera.com/m2/
Oct 06 2004
"Ilya Zaitseff" <sark7 mail333.com> escribió en el mensaje
news:opsff7sxywaaezs2 localhost...
|A problem with mixins and compiling to OBJ/LIB.
|
| <testmod.d>
| template TFoo()
| {
| void foo() {}
| }
|
| struct Bar
| {
| mixin TFoo!();
| void bar() {}
| }
|
| <testmain.d>
| import testmod;
|
| void main()
| {
| Bar f;
| f.foo();
| }
|
| DMD -c TESTMOD.D (Step X)
| LIB -c TESTMOD.LIB TESTMOD.OBJ
| DMD TESTMAIN.D TESTMOD.LIB
|
| DMD 0.102 gives link error:
|
| testmain.obj(testmain)
| Error 42: Symbol Undefined _D7testmod3Bar03fooFZv
|
| Yeah, because foo() is not in .lst from testmod.lib (LIB -l TESTMOD.LIB):
|
| Publics by name module
| __init_7testmod3Bar testmod
| _array_7testmod testmod
| _assert_7testmod testmod
| _D7testmod3Bar3barFZv testmod
|
| But, if we do (Step X) with DMD 0.101, all works perfect, and .lst is:
|
| Publics by name module
| __init_7testmod3Bar testmod
| _array_7testmod testmod
| _assert_7testmod testmod
| _D7testmod3Bar03fooFZv testmod
| _D7testmod3Bar3barFZv testmod
| --
| îÁÐÉÓÁÎÏ × ÐÏÞÔÏ×ÏÍ ËÌÉÅÎÔÅ ÂÒÁÕÚÅÒÁ Opera: http://www.opera.com/m2/
I think that's the bug Matthew reported, and that I'm also having. Thanks for
trimming it down!
-----------------------
Carlos Santander Bernal
Oct 06 2004
Ilya Zaitseff schrieb:
A problem with mixins and compiling to OBJ/LIB.
<testmod.d>
template TFoo()
{
void foo() {}
}
struct Bar
{
mixin TFoo!();
void bar() {}
}
<testmain.d>
import testmod;
void main()
{
Bar f;
f.foo();
}
DMD -c TESTMOD.D (Step X)
LIB -c TESTMOD.LIB TESTMOD.OBJ
DMD TESTMAIN.D TESTMOD.LIB
DMD 0.102 gives link error:
testmain.obj(testmain)
Error 42: Symbol Undefined _D7testmod3Bar03fooFZv
Can someone reproduce this bug under Linux?
I tried to reproduce it but failed to do so.
Thomas
Oct 16 2004









"Carlos Santander B." <carlos8294 msn.com> 