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

Imperatorn johan_forsberg_86 at hotmail.com
Thu Nov 25 09:00:52 UTC 2021


On Wednesday, 24 November 2021 at 17:06:21 UTC, BoQsc wrote:
> I'm not sure if I have sucessfully achieved something like this 
> before or is it even possible right now, but there is a sample 
> file that comes with DMD compiler: `D\dmd2\samples\d\winsamp.d`
>
> **The problem:** `winsamp.d` have to be compiled with `.def` 
> file.
> ```
> /+ Compile with:
>  +  dmd winsamp winsamp.def
>  + or:
>  +  dmd winsamp -L-Subsystem:Windows
>  +
>  + 64 bit version:
>  +  dmd -m64 winsamp -L-Subsystem:Windows user32.lib
>  +/
> ```
>
> This is how the `.def` file looks like
> (`D\dmd2\samples\d\winsamp.def`):
> ```
> EXETYPE NT
> SUBSYSTEM WINDOWS
>
> ```
>
> **The question:** Is there a way to include the `.def` file 
> instructions inside `.d` file, so that there won't be a need 
> for additional `.def` file when compiling. (`dmd winsamp`)

What most ppl do in that case is to just provide a script, for 
example build.cmd that just does what it needs. The user just 
clicks the script and it does everything for them.


More information about the Digitalmars-d-learn mailing list