win64 DLL stdout printing after main process completes

cc cc at nevernet.com
Mon Apr 19 18:04:44 UTC 2021


On Monday, 19 April 2021 at 16:00:25 UTC, frame wrote:
> You miss a core.stdc.stdio import in main().
> I also omit the def-File, maybe you have an error in it? It 
> shouldn't be necessary to include. It just did:
> ```
> dmd -m64 -ofmydll.dll -L/DLL mydll.d
> ```

Sorry, here's the def file, taken from the wiki example.
```
LIBRARY "mydll.dll"
EXETYPE NT
SUBSYSTEM WINDOWS
CODE SHARED EXECUTE
DATA WRITE
```
Incidentally I get some warnings regarding it when I compile:
```
mydll.def(2) : warning LNK4017: EXETYPE statement not supported 
for the target platform; ignored
mydll.def(3) : warning LNK4017: SUBSYSTEM statement not supported 
for the target platform; ignored
mydll.def(4) : warning LNK4017: CODE statement not supported for 
the target platform; ignored
mydll.def(5) : warning LNK4017: DATA statement not supported for 
the target platform; ignored
```
Are all those lines were intended for win32 dlls and whatever the 
x64 equivalents are are different?
Also, the example at the D wiki URL had a -L/IMPLIB in the 
command line but I get `LINK : fatal error LNK1146: no argument 
specified with option '/IMPLIB'` with that so I removed it.


More information about the Digitalmars-d-learn mailing list