Windows static linking question

2021-04-27 Thread frame via Digitalmars-d-learn
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

Re: Windows static linking question

2021-04-27 Thread Imperatorn via Digitalmars-d-learn
On Tuesday, 27 April 2021 at 06:29:40 UTC, frame wrote: From my source... ```d // main.d pragma(lib, common.lib); extern (C) void fun(bool something); ``` [...] Did you mean to use rdmd and not dmd? 樂

Re: Windows static linking question

2021-04-27 Thread frame via Digitalmars-d-learn
On Tuesday, 27 April 2021 at 07:13:16 UTC, Imperatorn wrote: On Tuesday, 27 April 2021 at 06:29:40 UTC, frame wrote: From my source... ```d // main.d pragma(lib, common.lib); extern (C) void fun(bool something); ``` [...] Did you mean to use rdmd and not dmd? 樂 I could not get it working

Re: Windows static linking question

2021-04-27 Thread frame via Digitalmars-d-learn
On Tuesday, 27 April 2021 at 07:55:53 UTC, Mike Parker wrote: On Tuesday, 27 April 2021 at 07:41:28 UTC, frame wrote: Did you mean to use rdmd and not dmd? 樂 I could not get it working using dmd. It gaves me LNK2001 linker errors. I honestly have no idea what rdmd else applies to the

Re: Windows static linking question

2021-04-27 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 27 April 2021 at 07:41:28 UTC, frame wrote: Did you mean to use rdmd and not dmd? 樂 I could not get it working using dmd. It gaves me LNK2001 linker errors. I honestly have no idea what rdmd else applies to the linker (should inspect it with sysinternals). What is your dmd

Re: Windows static linking question

2021-04-27 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 27 April 2021 at 08:33:23 UTC, frame wrote: On Tuesday, 27 April 2021 at 07:55:53 UTC, Mike Parker wrote: On Tuesday, 27 April 2021 at 07:41:28 UTC, frame wrote: Did you mean to use rdmd and not dmd? 樂 I could not get it working using dmd. It gaves me LNK2001 linker errors. I

Re: Windows static linking question

2021-04-27 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 27 April 2021 at 10:43:20 UTC, frame wrote: On Tuesday, 27 April 2021 at 08:50:37 UTC, Mike Parker wrote: What specifically are the linker errors? Is it referring to `_DLLMainCRTStartup` or something else? Various "unresolved external symbol", mostly ```..._ClassZ```,

Re: Windows static linking question

2021-04-27 Thread frame via Digitalmars-d-learn
On Tuesday, 27 April 2021 at 08:50:37 UTC, Mike Parker wrote: What specifically are the linker errors? Is it referring to `_DLLMainCRTStartup` or something else? Various "unresolved external symbol", mostly ```..._ClassZ```, ```...__ModuleInfoZ```, ```..._initZ``` from my classes and

Install of nightly with install.sh is not latest version

2021-04-27 Thread Jamie via Digitalmars-d-learn
When using the install.sh script and choosing 'dmd-nightly' I'm currently getting DMD v2.091.0-beta.2-master-ec39fe5 (the folder downloaded is dmd-master-2020-03-10). I can install a more recent version using install 'dmd' etc. Is this a bug? Or am I just using it incorrectly? Cheers

Re: Windows static linking question

2021-04-27 Thread frame via Digitalmars-d-learn
On Tuesday, 27 April 2021 at 11:08:29 UTC, Mike Parker wrote: So you have more than just common.d? You need to compile and link all of your source modules. The big `-I` is for imports, for the compiler to know what symbols are available. You will also need to either include all of the source

Re: DIP1000 and immutable

2021-04-27 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 27 April 2021 at 14:28:12 UTC, jmh530 wrote: However, should it ever matter if you escape an immutable? Your example is a pretty clear case of use-after-free if gloin actually did escape the reference and kept it after main returned. I tried basically the same thing in Rust and

Re: DIP1000 and immutable

2021-04-27 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 27 April 2021 at 14:44:48 UTC, Adam D. Ruppe wrote: On Tuesday, 27 April 2021 at 14:28:12 UTC, jmh530 wrote: However, should it ever matter if you escape an immutable? Your example is a pretty clear case of use-after-free if gloin actually did escape the reference and kept it

Re: vibe-core sporadic internal errors

2021-04-27 Thread Imperatorn via Digitalmars-d-learn
On Tuesday, 27 April 2021 at 15:48:01 UTC, Steven Schveighoffer wrote: I suspect vibe-core or event core may have some subtle bugs in them that are not easily repeatable, but often result in half-rendered web pages. [...] Need a full trace to be able to get anywhere I think.

Re: Install of nightly with install.sh is not latest version

2021-04-27 Thread Jamie via Digitalmars-d-learn
On Tuesday, 27 April 2021 at 12:35:52 UTC, Jamie wrote: When using the install.sh script and choosing 'dmd-nightly' I'm currently getting DMD v2.091.0-beta.2-master-ec39fe5 (the folder downloaded is dmd-master-2020-03-10). I can install a more recent version using install 'dmd' etc. Is this

vibe-core sporadic internal errors

2021-04-27 Thread Steven Schveighoffer via Digitalmars-d-learn
I suspect vibe-core or event core may have some subtle bugs in them that are not easily repeatable, but often result in half-rendered web pages. Has anyone else seen this? I recently updated to the latest vibe-core and vibe to see if the problem goes away and it doesn't. A log of the

DIP1000 and immutable

2021-04-27 Thread jmh530 via Digitalmars-d-learn
What is the motivation for DIP1000 also applying to immutable? For instance, in the code (compiled with -dip1000), adapted from the spec [1], you get the same errors with immutable function parameters as you would with mutable ones. However, should it ever matter if you escape an immutable?