Re: How send parameters to DMD when using DUB

2021-04-19 Thread Marcone via Digitalmars-d-learn
/+ dub.sdl: dependency "telega" version="~>0.2.0" lflags "C:\\Users\\Usuario\\Arquivos\\Sublime Text Build 3211\\Data\\Packages\\resources.res" platform="dmd" +/ Solved replaceing dflags to lflags

Re: How send parameters to DMD when using DUB

2021-04-19 Thread Marcone via Digitalmars-d-learn
I'm trying this code but do not work. /+ dub.sdl: dependency "telega" version="~>0.2.0" dflags "C:\\Users\\Usuario\\Arquivos\\Sublime Text Build 3211\\Data\\Packages\\resources.res" platform="dmd" +/

How send parameters to DMD when using DUB

2021-04-19 Thread Marcone via Digitalmars-d-learn
I need add resources. But how can I make it using DUB?

Re: win64 DLL stdout printing after main process completes

2021-04-19 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 19 April 2021 at 18:05:46 UTC, cc wrote: This seems to work if I flush after every printf or write in both main and the dll. I was under the impression they were supposed to share the same IO buffers though, is this not the case? Very little in D dlls right now are shared, so

Re: win64 DLL stdout printing after main process completes

2021-04-19 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 19 April 2021 at 14:55:03 UTC, cc wrote: https://wiki.dlang.org/Win32_DLLs_in_D I'm starting to think half that page should just be deleted... the version up top with the druntime dll_process_attach etc versions should really be used in all cases. And that gets even simpler too,

Re: win64 DLL stdout printing after main process completes

2021-04-19 Thread cc via Digitalmars-d-learn
On Monday, 19 April 2021 at 16:04:28 UTC, Mike Parker wrote: On Monday, 19 April 2021 at 14:55:03 UTC, cc wrote: And upon running, the output I receive is: ``` [Main] Start [Main] x: 5 [Main] Finished [Main] END [dll] DLL_PROCESS_ATTACH [dll] static this for mydll [dll] MyDLL_Test [dll]

Re: win64 DLL stdout printing after main process completes

2021-04-19 Thread cc via Digitalmars-d-learn
On Monday, 19 April 2021 at 16:00:25 UTC, frame wrote: You miss a core.stdc.stdio import in main(). I also omit the def-File, maybe you have an error in it? It shouldn't be necessary to include. It just did: ``` dmd -m64 -ofmydll.dll -L/DLL mydll.d ``` Sorry, here's the def file, taken from

Re: How to skip class/function when using -HC flag to generate C++ headers?

2021-04-19 Thread evilrat via Digitalmars-d-learn
On Monday, 19 April 2021 at 17:37:31 UTC, MoonlightSentinel wrote: On Monday, 19 April 2021 at 16:26:20 UTC, evilrat wrote: Or maybe there is a way to tell it whitelist/blacklist modules? The header generator only translates modules passed on the command line, other declarations are omitted

Re: How to skip class/function when using -HC flag to generate C++ headers?

2021-04-19 Thread MoonlightSentinel via Digitalmars-d-learn
On Monday, 19 April 2021 at 16:26:20 UTC, evilrat wrote: Or maybe there is a way to tell it whitelist/blacklist modules? The header generator only translates modules passed on the command line, other declarations are omitted unless they are required by another symbol. Omit the modules from

How to skip class/function when using -HC flag to generate C++ headers?

2021-04-19 Thread evilrat via Digitalmars-d-learn
It is annoying, it tries to write all derived classes where it only needs interface. Or maybe there is a way to tell it whitelist/blacklist modules? Marking class private is not an option.

Re: win64 DLL stdout printing after main process completes

2021-04-19 Thread Mike Parker via Digitalmars-d-learn
On Monday, 19 April 2021 at 14:55:03 UTC, cc wrote: And upon running, the output I receive is: ``` [Main] Start [Main] x: 5 [Main] Finished [Main] END [dll] DLL_PROCESS_ATTACH [dll] static this for mydll [dll] MyDLL_Test [dll] DLL_PROCESS_DETACH [dll] static ~this for mydll ``` I would expect

Re: win64 DLL stdout printing after main process completes

2021-04-19 Thread frame via Digitalmars-d-learn
On Monday, 19 April 2021 at 14:55:03 UTC, cc wrote: I would expect the first three lines of dll output to precede the "[Main] x:" line at least. Is there something I'm doing wrong? Do I need to somehow pass a reference to the main stdio to the DLL's D runtime similar to how the GC can be

win64 DLL stdout printing after main process completes

2021-04-19 Thread cc via Digitalmars-d-learn
I'm not sure if this is something unique to D or not, but I've having a minor issue where stdout output from a DLL (either via printf or phobos std.stdio write) is not displayed until after the main process has completed. I'm making a project based around the example at

Re: Shared with synchronized

2021-04-19 Thread Per Nordlöw via Digitalmars-d-learn
On Monday, 4 March 2019 at 00:07:39 UTC, r-const-dev wrote: I'm trying to implement a thread safe class, guarding data access with synchronized and atomicOp. To get more help with memory safety checking from the compiler, please instead use `@safe` as ```d import std.typecons : Nullable;

Re: What are virtual functions?

2021-04-19 Thread FeepingCreature via Digitalmars-d-learn
On Sunday, 18 April 2021 at 23:04:26 UTC, ShadoLight wrote: On Wednesday, 14 April 2021 at 14:06:18 UTC, FeepingCreature wrote: On Wednesday, 14 April 2021 at 13:43:20 UTC, Berni44 wrote: [..] Covariance is related ... [..] The opposite (contravariance) happens ... [..] Nice answer