typecons wrap error
Oleg B
code.viator at gmail.com
Thu Nov 21 06:07:57 PST 2013
What I do wrong?
[code]
import std.stdio, std.typecons;
interface A
{
void foo();
void bar( int );
}
class B
{
void foo() { writeln( "B.foo" ); }
void bar( int i ) { writefln( "B.bar(%d)", i ); }
}
void call( A a )
{
a.foo();
a.bar( 12 );
}
void main()
{
auto b = new B;
A a = wrap!A(b);
call( a );
}
[/code]
then I run dmd, it fails with error
$ dmd -run tcons.d
tcons.o: In function
`_D3std8typecons19__T4wrapTC5tcons1AZ19__T4wrapTC5tcons1BZ4Impl587__T8mixinAllVAyaa139_6f766572726964652052657475726e5479706521285461726765744d656d626572735b305d2e747970652920666f6f28506172616d65746572547970655475706c6521285461726765744d656d626572735b305d2e7479706529206172677329207b2072657475726e205f777261705f736f757263652e666f6f28666f72776172642161726773293b207dVAyaa139_6f766572726964652052657475726e5479706521285461726765744d656d626572735b315d2e74797065292062617228506172616d65746572547970655475706c6521285461726765744d656d626572735b315d2e7479706529206172677329207b2072657475726e205f777261705f736f757263652e62617228666f72776172642161726773293b207dZ300__T8mixinAllVAyaa139_6f766572726964652052657475726e5479706521285461726765744d656d626572735b315d2e74797065292062617228506172616d65746572547970655475706c6521285461726765744d656d626572735b315d2e7479706529206172677329207b2072657475726e205f777261705f736f757263652e62617228666f72776172642161726773293b207dZ3barMFiZv':
tcons.d:(.text._D3std8typecons19__T4wrapTC5tcons1AZ19__T4wrapTC5tcons1BZ4Impl587__T8mixinAllVAyaa139_6f766572726964652052657475726e5479706521285461726765744d656d626572735b305d2e747970652920666f6f28506172616d65746572547970655475706c6521285461726765744d656d626572735b305d2e7479706529206172677329207b2072657475726e205f777261705f736f757263652e666f6f28666f72776172642161726773293b207dVAyaa139_6f766572726964652052657475726e5479706521285461726765744d656d626572735b315d2e74797065292062617228506172616d65746572547970655475706c6521285461726765744d656d626572735b315d2e7479706529206172677329207b2072657475726e205f777261705f736f757263652e62617228666f72776172642161726773293b207dZ300__T8mixinAllVAyaa139_6f766572726964652052657475726e5479706521285461726765744d656d626572735b315d2e74797065292062617228506172616d65746572547970655475706c6521285461726765744d656d626572735b315d2e7479706529206172677329207b2072657475726e205f777261705f736f757263652e62617228666f72776172642161726773293b207dZ3barMFiZv+0x54):
undefined reference to
`_D3std8typecons19__T4wrapTC5tcons1AZ19__T4wrapTC5tcons1BZ4Impl587__T8mixinAllVAyaa139_6f766572726964652052657475726e5479706521285461726765744d656d626572735b305d2e747970652920666f6f28506172616d65746572547970655475706c6521285461726765744d656d626572735b305d2e7479706529206172677329207b2072657475726e205f777261705f736f757263652e666f6f28666f72776172642161726773293b207dVAyaa139_6f766572726964652052657475726e5479706521285461726765744d656d626572735b315d2e74797065292062617228506172616d65746572547970655475706c6521285461726765744d656d626572735b315d2e7479706529206172677329207b2072657475726e205f777261705f736f757263652e62617228666f72776172642161726773293b207dZ300__T8mixinAllVAyaa139_6f766572726964652052657475726e5479706521285461726765744d656d626572735b315d2e74797065292062617228506172616d65746572547970655475706c6521285461726765744d656d626572735b315d2e7479706529206172677329207b2072657475726e205f777261705f736f757263652e62617228666f72776172642161726773293b207dZ3barMFiZv990__T7forwardS974_D3std8typecons19__T4wrapTC5tcons1AZ19__T4wrapTC5tcons1BZ4Impl587__T8mixinAllVAyaa139_6f766572726964652052657475726e5479706521285461726765744d656d626572735b305d2e747970652920666f6f28506172616d65746572547970655475706c6521285461726765744d656d626572735b305d2e7479706529206172677329207b2072657475726e205f777261705f736f757263652e666f6f28666f72776172642161726773293b207dVAyaa139_6f766572726964652052657475726e5479706521285461726765744d656d626572735b315d2e74797065292062617228506172616d65746572547970655475706c6521285461726765744d656d626572735b315d2e7479706529206172677329207b2072657475726e205f777261705f736f757263652e62617228666f72776172642161726773293b207dZ300__T8mixinAllVAyaa139_6f766572726964652052657475726e5479706521285461726765744d656d626572735b315d2e74797065292062617228506172616d65746572547970655475706c6521285461726765744d656d626572735b315d2e7479706529206172677329207b2072657475726e205f777261705f736f757263652e62617228666f72776172642161726773293b207dZ3barMFiZv8_param_0iZ8__T3fwdZ3fwdMFNbNdNfZi'
collect2: error: ld returned 1 exit status
--- errorlevel 1
More information about the Digitalmars-d-learn
mailing list