linker error

Tobias Pankrath tobias at pankrath.net
Mon Jul 9 02:15:51 PDT 2012


On Monday, 9 July 2012 at 08:45:25 UTC, lodo wrote:
> When I try to compile the code below I get this error:
>  prova00.obj(prova00)
>  Error 42: Symbol Undefined _D6prova013implementThisFZi
>  --errorlevel 1
>
> This is my code:
>
> File prova0.d:
> import std.stdio;
> int implementThis();
> void callThis()
> {
> 	writefln("%d",implementThis());
> }
>
> File prova00.d:
> import prova0;
> int implementThis()
> {
> 	return 42;
> }
> void main()
> {
> 	callThis();
> }
>
> Can someone help me, please?

The module gets mangled into the function name. So the 
implementThis that you declare in prova0.d is different from the 
one you implement in prova00.d.

You could use externC to prevent the mangling.



More information about the Digitalmars-d-learn mailing list