From my source...

```d
// main.d
pragma(lib, common.lib);
extern (C) void fun(bool something);
```

```d
// common.d
export extern (C) void fun(bool something) {
    // ...
}
```
...I'm creating a static linked DLL with this command...

```
rdmd --build-only -L/DLL -L/OUT:common.dll -m64 -of=common.dll common.d
```

... and this works.

However, I get a ```std.file.FileException@std\file.d(991): Attempting to rename file common.dll.tmp to common.dll``` error every time at compiling because of the ```-L/OUT``` argument. But I cannot omit it because it would create and link a common.dll.tmp instead - for whatever reason.


I know there is a ```-lib``` switch which also can create a common.lib, but that's obviously not the same as the LIB does not target to the DLL and the code ends just compiled in than linked.

So, is there another switch combo to achieve static linking by creating a LIB-file? Like a ```-lib -target=```?

Reply via email to