linker error

lodo lodovico at giaretart.net
Mon Jul 9 07:06:51 PDT 2012


On Monday, 9 July 2012 at 09:15:52 UTC, Tobias Pankrath wrote:
> 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.

Now it works! I added "extern(C)" to both declaration and 
implementation of "implementThis". Thank you, Tobias.




More information about the Digitalmars-d-learn mailing list