I have included the source to a simple 64-bit Windows program.
It compiles and runs fine with ```dmd -m64
-L="/Subsystem:Windows" -L="/Entry:Main" Main.d```. But compiling
with ```-betterC``` using the following throws up a linker error,
```dmd -m64 -betterC -L="/Subsystem:Windows" -L="/Entry:M
Thank you, that seems to have been the source of the error.
I am receiving this error:
```
Error: no property `offsetof` for type `char*`
```
from this snippet:
```d
import core.sys.windows.setupapi;
void main() {
SP_DEVICE_INTERFACE_DETAIL_DATA_A DeviceInterfaceDetail;
uint Offset = DeviceInterfaceDetail.DevicePath.offsetof;
}
```
You may try
Thank you, that seems to have resolved the issue, though I wish
these sorts of problems would stop cropping up, they are souring
the experience with the language.
On Friday, 19 August 2022 at 14:30:50 UTC, kinke wrote:
Oh and `DevicePath()` is a convenience member returning a
pointer to the 'dynamic array' (as the array decays to a
pointer in C too), so no need to fiddle with `.offsetof` and
computing the pointer manually.
I am using ```-BetterC```, so