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

BoQsc vaidas.boqsc at gmail.com
Wed Nov 24 17:06:21 UTC 2021


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`)




More information about the Digitalmars-d-learn mailing list