Optional name mangling

JImmy Cao jcao219 at gmail.com
Sat Jul 21 19:06:35 PDT 2012


On Saturday, 21 July 2012 at 23:53:01 UTC, Stuart wrote:
> On Saturday, 21 July 2012 at 22:51:14 UTC, Adam D. Ruppe wrote:
>> On Saturday, 21 July 2012 at 22:38:32 UTC, Stuart wrote:
>>> Attempts to bind to a function called _PathRenameExtension. 
>>> Which is, naturally, of no use whatsoever.
>>
>> That is the norm on Windows though:
>
> Granted. But not everyone's exported functions are prefixed 
> with an underscore. I've written DLLs myself using __dllexport, 
> and they've been named normally. It'd just be helpful to have 
> the option, y'know?
>
>> If you're using implib on a DLL to make a .lib for D though,
>> the /S switch might help:
>> http://www.digitalmars.com/ctg/implib.html
>> "Prepend '_' to exported internal names."
>
> I'm sorry, but the /S (or /system) switch doesn't seem to do 
> anything. I still get non-underscore-prefixed output in my .lib 
> file. I opened it in a hex editor to verify this; and D says 
> "Error 42: Symbol Undefined _PathRenameExtension".
>
> Do I need a different copy of implib, maybe? When I call it 
> with /?, I get:
>
> ---
> Digital Mars Import Library Manager Version 7.6B1n
> Copyright (C) Digital Mars 2000.  All Rights Reserved.
> Usage:
>         IMPLIB [switches] implibname.lib [ file.dll | file.def ]
> switches:
>         /?      Print this message
>         /b      Batch
>         /h      Print this message
>         /i      Ignore case of symbols
>         /noi    Be case sensitive. Mark library as case 
> sensitive
>         /nowep  Ignore WEP
>         /p:number       Set page size to number (a power of 2)
>         /system         Prepend '_' to exported internal names 
> (NT system DLL)
> ---

Use either /s or /system


More information about the Digitalmars-d mailing list