June 25, 2015 Compiles but does not link | ||||
---|---|---|---|---|
| ||||
The code snippet below compiles but the linker fails with Error 42: Symbol undefined. What am I doing wrong? void main() { int foo(int a); alias FP = int delegate(int); FP fp = &foo; } Paul |
June 25, 2015 Re: Compiles but does not link | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paul D Anderson | On Thursday, 25 June 2015 at 00:24:23 UTC, Paul D Anderson wrote:
> The code snippet below compiles but the linker fails with Error 42: Symbol undefined.
>
> What am I doing wrong?
>
> void main()
> {
> int foo(int a);
> alias FP = int delegate(int);
> FP fp = &foo;
> }
>
> Paul
Uh, never mind. I got so focused on the delegate I forgot to give the function a body.
|
Copyright © 1999-2021 by the D Language Foundation