Re: where is the memory corruption?

2020-12-10 Thread Patrick Schluter via Digitalmars-d-learn
On Wednesday, 9 December 2020 at 21:28:04 UTC, Paul Backus wrote: On Wednesday, 9 December 2020 at 21:21:58 UTC, ag0aep6g wrote: D's wchar is not C's wchar_t. D's wchar is 16 bits wide. The width of C's wchar_t is implementation-defined. In your case it's probably 32 bits. In D, C's

Undefined reference error at linktime with unittests

2020-12-10 Thread z via Digitalmars-d-learn
When compiling with unit tests(via «dub test», or adding «dflags "-unittest"»), i'm getting this error at link time : lld-link: error: undefined symbol: _D5packagename9subpackage9__mixin119type8toStringMFZAya The same occurs with OPTLINK. Curiously, looking at the incriminated .lib file with

Re: Undefined reference error at linktime with unittests

2020-12-10 Thread ag0aep6g via Digitalmars-d-learn
On 10.12.20 13:28, z wrote: When compiling with unit tests(via «dub test», or adding «dflags "-unittest"»), i'm getting this error at link time : lld-link: error: undefined symbol: _D5packagename9subpackage9__mixin119type8toStringMFZAya The same occurs with OPTLINK. Curiously, looking at

Re: where is the memory corruption?

2020-12-10 Thread Виталий Фадеев via Digitalmars-d-learn
On Wednesday, 9 December 2020 at 20:35:21 UTC, Jack wrote: I'm on linux/opensuse, trying to pass a wchar_* from C to D but I'm getting only the first letter of that string. Could someone help figure out why? [...] May be this help to you: auto s2 = to!string(s); to auto s2

CMD && comand not work

2020-12-10 Thread Marcone via Digitalmars-d-learn
In this very generic example && not work to finalize the instruct and start a new instruct. Yes, I know dmd can build and run without it, but this is only a example. execute(["cmd", "/c", "dmd test.d", "&&", "start test.exe"]); How can I substitute && ?

Re: Undefined reference error at linktime with unittests

2020-12-10 Thread z via Digitalmars-d-learn
On Thursday, 10 December 2020 at 14:51:51 UTC, ag0aep6g wrote: ... Thank you for the explanation on mangles. The problem was caused by an «unittest{ void main() }» declaration in an import's source file, and for some reason it had both passed compilation and not resulted in the usual

Re: CMD && comand not work

2020-12-10 Thread Paul Backus via Digitalmars-d-learn
On Thursday, 10 December 2020 at 21:01:30 UTC, Marcone wrote: In this very generic example && not work to finalize the instruct and start a new instruct. Yes, I know dmd can build and run without it, but this is only a example. execute(["cmd", "/c", "dmd test.d", "&&", "start test.exe"]);

Re: CMD && comand not work

2020-12-10 Thread Jack via Digitalmars-d-learn
On Thursday, 10 December 2020 at 21:01:30 UTC, Marcone wrote: In this very generic example && not work to finalize the instruct and start a new instruct. Yes, I know dmd can build and run without it, but this is only a example. execute(["cmd", "/c", "dmd test.d", "&&", "start test.exe"]);

read till EOF from stdin

2020-12-10 Thread kdevel via Digitalmars-d-learn
Currently as a workaround I read all the chars from stdin with import std.file; auto s = cast (string) read("/dev/fd/0"); after I found that you can't read from stdin. This is of course non-portable Linux only code. In perl I frequently use the idiom $s = join ('', <>); that