On Monday, 7 June 2021 at 20:13:03 UTC, frame wrote:
On Monday, 7 June 2021 at 02:33:38 UTC, Jack wrote:

What am I missing?

If this runs under Windows, there is no dlopen(), maybe a wrapper to LoadLibrary() but this will need to call a DllMain() in the DLL if I am not wrong. Is there a DllMain?

I just noticied that's supposed to have a DllMain even tho the [code example](https://github.com/NotSpooky/node_dlang/blob/master/examples/type_examples/source/example.d) from node_dlang doesn't have one and it was working(?) I added one in my code but it give same error. I added like this:

```d
module foo;

import std.stdio : stderr;
import node_dlang;
import core.sys.windows.windows;
import core.sys.windows.dll;

mixin SimpleDllMain;

extern(C):

    void atStart(napi_env env)
    {
        import std.stdio;
        writeln (`Loaded D native library!`);
    }

    int ultimate()
    {
        return 43;
    }

mixin exportToJs! (ultimate, MainFunction!atStart);
```

Reply via email to