Name mangling problem with tiny Windows 10 load-time DLL example

Siemargl inqnone at gmail.com
Mon Mar 1 09:01:17 UTC 2021


On Sunday, 28 February 2021 at 23:00:56 UTC, WhatMeWorry wrote:
> On Sunday, 28 February 2021 at 22:10:21 UTC, Siemargl wrote:
>> On Sunday, 28 February 2021 at 18:29:11 UTC, WhatMeWorry wrote:
>>> It seems pretty obvious the problem is with name mangling. 
>>> But how to fix it?
>>>
>> fixing
>>>    int numb = 1;
>>
>> and your example work correct
>>
>> ldc 1.24 / win10
>>
>> P.S.I'm not recommend using such keywords as 'file', may cross 
>> with other modules.
>
> I double checked my posting and of course works it now 
> works!?!?  I've been having trouble where it works and then it 
> doesn't. I've been using examples with file.d, file1.d, 
> file2.d, etc.  I also came across the note that Windows file 
> system is not case sensitive. Or is that case in-sensitive?
>
> This worked fine for Linux (Ubuntu) so you might be on to 
> something.

Win10. Just try delete all obj, dll, lib and do full recompile 
from scratch.

module patron;
import file;	
void main()
{
     import std.stdio;
     int numb = 1;
     writeln("mangled name of addOne is ", addOne.mangleof);
     numb = addOne(numb);
     writeln(numb);
}

---------
E:\VSProjects\testjunk\D_load_dll>patron.exe                      
                                                                   
                                                                   
              mangled name of addOne is _D4file6addOneFiZi         
                                                                   
                                                                   
                           2




More information about the Digitalmars-d-learn mailing list