Include .def definition file information for the linker into a .d source file

Imperatorn johan_forsberg_86 at hotmail.com
Wed Nov 24 20:29:36 UTC 2021


On Wednesday, 24 November 2021 at 17:38:42 UTC, BoQsc wrote:
> On Wednesday, 24 November 2021 at 17:29:09 UTC, Adam D Ruppe 
> wrote:
>> On Wednesday, 24 November 2021 at 17:23:07 UTC, BoQsc wrote:
>>> The many times I tried this pragma, it did not even get 
>>> recognised as pragma at all.
>>
>> You need to use `dmd -m32mscoff` or `dmd -m64`. Plain `dmd` 
>> won't work.
>>
>> If -m32mscoff and -m64 still don't work, what's your dmd 
>> version? It was added in 2.083.0, November 2018.
>
> Thanks, seems to work now.
>
> I had to add these two pragmas to the `winsamp.d`
> ```
> pragma(linkerDirective, "/subsystem:windows");
> pragma(lib, "user32.lib");
> ```
>
> And as you mentioned give additional`-m32mscoff` flag to the 
> compiler.
>
> `dmd winsamp.d -m32mscoff`
>
> **The obvious problem now is:** How can you compile without 
> specifying the flags. With plain dmd.

Just a quick question before going deeper. Why do you not want to 
supply the definition file?


More information about the Digitalmars-d-learn mailing list