Re: how do i fix this node_dlang error?

2021-06-08 Thread Jack via Digitalmars-d-learn
On Tuesday, 8 June 2021 at 03:04:39 UTC, Mike Parker wrote: On Tuesday, 8 June 2021 at 00:58:12 UTC, Jack wrote: the dll which I was just build with dub command? how I have a version mismatch if they're the very same file? Electron embeds node and does not use whatever you have on your

Re: how do i fix this node_dlang error?

2021-06-08 Thread Jack via Digitalmars-d-learn
On Tuesday, 8 June 2021 at 04:56:27 UTC, NotSpooky wrote: On Tuesday, 8 June 2021 at 03:04:39 UTC, Mike Parker wrote: On Tuesday, 8 June 2021 at 00:58:12 UTC, Jack wrote: [...] Electron embeds node and does not use whatever you have on your system. So if there’s a mismatch between the

Re: how do i fix this node_dlang error?

2021-06-07 Thread NotSpooky via Digitalmars-d-learn
On Tuesday, 8 June 2021 at 03:04:39 UTC, Mike Parker wrote: On Tuesday, 8 June 2021 at 00:58:12 UTC, Jack wrote: the dll which I was just build with dub command? how I have a version mismatch if they're the very same file? Electron embeds node and does not use whatever you have on your

Re: how do i fix this node_dlang error?

2021-06-07 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 8 June 2021 at 00:58:12 UTC, Jack wrote: the dll which I was just build with dub command? how I have a version mismatch if they're the very same file? Electron embeds node and does not use whatever you have on your system. So if there’s a mismatch between the embedded version and

Re: how do i fix this node_dlang error?

2021-06-07 Thread Jack via Digitalmars-d-learn
On Tuesday, 8 June 2021 at 00:00:50 UTC, Mike Parker wrote: On Monday, 7 June 2021 at 22:24:03 UTC, Jack wrote: I think the entry point function is ```void atStart(napi_env env) {}``` so there's no DllMain... DLLMain is not strictly required. It's called by the system loader when the DLL

Re: how do i fix this node_dlang error?

2021-06-07 Thread Mike Parker via Digitalmars-d-learn
On Monday, 7 June 2021 at 22:24:03 UTC, Jack wrote: I think the entry point function is ```void atStart(napi_env env) {}``` so there's no DllMain... DLLMain is not strictly required. It's called by the system loader when the DLL is first loaded into the process. The MainFunction for node

Re: how do i fix this node_dlang error?

2021-06-07 Thread Jack via Digitalmars-d-learn
On Monday, 7 June 2021 at 20:37:19 UTC, MoonlightSentinel wrote: On Monday, 7 June 2021 at 19:03:44 UTC, Jack wrote: actually i didnt so I just added: ```d shared static this() { Runtime.initialize(); } shared static ~this() { Runtime.terminate(); } ``` but it didn't change

Re: how do i fix this node_dlang error?

2021-06-07 Thread Jack via Digitalmars-d-learn
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

Re: how do i fix this node_dlang error?

2021-06-07 Thread Jack via Digitalmars-d-learn
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

Re: how do i fix this node_dlang error?

2021-06-07 Thread MoonlightSentinel via Digitalmars-d-learn
On Monday, 7 June 2021 at 19:03:44 UTC, Jack wrote: actually i didnt so I just added: ```d shared static this() { Runtime.initialize(); } shared static ~this() { Runtime.terminate(); } ``` but it didn't change anything That doesn't work because `Runtime.initialize()` is

Re: how do i fix this node_dlang error?

2021-06-07 Thread frame via Digitalmars-d-learn
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?

Re: how do i fix this node_dlang error?

2021-06-07 Thread Jack via Digitalmars-d-learn
On Monday, 7 June 2021 at 17:22:48 UTC, MoonlightSentinel wrote: On Monday, 7 June 2021 at 02:33:38 UTC, Jack wrote: What am I missing? Does your code / `node_dlang` initialize Druntime before calling `writeln`? actually i didnt so I just added: ```d shared static this() {

Re: how do i fix this node_dlang error?

2021-06-07 Thread MoonlightSentinel via Digitalmars-d-learn
On Monday, 7 June 2021 at 02:33:38 UTC, Jack wrote: What am I missing? Does your code / `node_dlang` initialize Druntime before calling `writeln`? Try replacing the `writeln` with `puts` (from `core.stdc.stdio`) which doesn't require an initialized runtime.

Re: how do i fix this node_dlang error?

2021-06-06 Thread Jack via Digitalmars-d-learn
On Sunday, 6 June 2021 at 21:44:44 UTC, NotSpooky wrote: On Sunday, 6 June 2021 at 04:25:39 UTC, Jack wrote: I'm trying to use the node_dlang pakckage but the code example from [this repo](https://github.com/NotSpooky/node_dlang/tree/v0.4.11/examples) isn't working the command ```dub

Re: how do i fix this node_dlang error?

2021-06-06 Thread Jack via Digitalmars-d-learn
On Sunday, 6 June 2021 at 17:32:57 UTC, Mike Parker wrote: On Sunday, 6 June 2021 at 15:42:55 UTC, Jack wrote: 0.4.11\node_dlang\source\node_dlang.d(137,11): Error: none of the overloads of `this` are callable using argument types `(string, string, ulong, Throwable)`, candidates are: [...]

Re: how do i fix this node_dlang error?

2021-06-06 Thread NotSpooky via Digitalmars-d-learn
On Sunday, 6 June 2021 at 04:25:39 UTC, Jack wrote: I'm trying to use the node_dlang pakckage but the code example from [this repo](https://github.com/NotSpooky/node_dlang/tree/v0.4.11/examples) isn't working the command ```dub build``` is fine but ```node example.js``` retuns an error

Re: how do i fix this node_dlang error?

2021-06-06 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 6 June 2021 at 15:42:55 UTC, Jack wrote: 0.4.11\node_dlang\source\node_dlang.d(137,11): Error: none of the overloads of `this` are callable using argument types `(string, string, ulong, Throwable)`, candidates are: C:\D\dmd2\windows\bin\..\..\src\druntime\import\object.d(2440,30):

Re: how do i fix this node_dlang error?

2021-06-06 Thread Jack via Digitalmars-d-learn
On Sunday, 6 June 2021 at 06:10:18 UTC, Mike Parker wrote: On Sunday, 6 June 2021 at 04:25:39 UTC, Jack wrote: I'm trying to use the node_dlang pakckage but the code example from [this repo](https://github.com/NotSpooky/node_dlang/tree/v0.4.11/examples) isn't working the command ```dub

Re: how do i fix this node_dlang error?

2021-06-06 Thread Jack via Digitalmars-d-learn
On Sunday, 6 June 2021 at 06:10:18 UTC, Mike Parker wrote: On Sunday, 6 June 2021 at 04:25:39 UTC, Jack wrote: I'm trying to use the node_dlang pakckage but the code example from [this repo](https://github.com/NotSpooky/node_dlang/tree/v0.4.11/examples) isn't working the command ```dub

Re: how do i fix this node_dlang error?

2021-06-06 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 6 June 2021 at 04:25:39 UTC, Jack wrote: I'm trying to use the node_dlang pakckage but the code example from [this repo](https://github.com/NotSpooky/node_dlang/tree/v0.4.11/examples) isn't working the command ```dub build``` is fine but ```node example.js``` retuns an error