digitalmars.D.bugs - (0.102) A problem with mixins and compiling to OBJ/LIB.
- "Ilya Zaitseff" <sark7 mail333.com> Oct 06 2004
- "Carlos Santander B." <carlos8294 msn.com> Oct 06 2004
- "Thomas Kuehne" <eisvogel users.sourceforge.net> Oct 16 2004
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> 