Re: Getting compiler Segfault

2018-02-04 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, February 04, 2018 13:54:17 Stefan Koch via Digitalmars-d-learn wrote: > On Sunday, 4 February 2018 at 12:52:22 UTC, Ur@nuz wrote: > > Getting compiler stack overflow when building my project, but > > still do not know how to localize piece of code that triggers > > this bug. Maybe this

Re: Interfacing with C++

2018-02-04 Thread rjframe via Digitalmars-d-learn
On Sun, 04 Feb 2018 08:33:20 +, Mike Parker wrote: > Though, I'm curious why anyone would want to declare a callback in a C++ > program as cdecl only on Windows and use the default C++ > convention everywhere else. I suggest you dig into it and make sure > that's what's intended. And good

Re: Interfacing with C++

2018-02-04 Thread infinityplusb via Digitalmars-d-learn
On Sunday, 4 February 2018 at 08:33:20 UTC, Mike Parker wrote: On Sunday, 4 February 2018 at 08:17:31 UTC, Mike Parker wrote: Assuming this is OpenCV ... it is, everyone keeps saying writing bindings in D is super easy ... I feel this is a slight simplification. :( version(Windows)

Re: rdmd main.d leads to Segmentation fault

2018-02-04 Thread Timoses via Digitalmars-d-learn
On Thursday, 1 February 2018 at 09:01:34 UTC, Kagamin wrote: On Wednesday, 31 January 2018 at 16:59:15 UTC, Timoses wrote: And I would need to do what about it? Sorry, I'm not familiar with assembly code stuff in detail. You can try to see if it works on another distro or version. It does

Re: Getting compiler Segfault

2018-02-04 Thread Stefan Koch via Digitalmars-d-learn
On Sunday, 4 February 2018 at 12:52:22 UTC, Ur@nuz wrote: Getting compiler stack overflow when building my project, but still do not know how to localize piece of code that triggers this bug. Maybe this bug is already registered in bugzilla or someone could give some advice where to dig into?

Getting compiler Segfault

2018-02-04 Thread Ur@nuz via Digitalmars-d-learn
Getting compiler stack overflow when building my project, but still do not know how to localize piece of code that triggers this bug. Maybe this bug is already registered in bugzilla or someone could give some advice where to dig into? Just runed building under gdb and got the following stack

Re: Setting up DMD on windows

2018-02-04 Thread Seb via Digitalmars-d-learn
On Sunday, 4 February 2018 at 17:11:21 UTC, Rubn wrote: On Sunday, 4 February 2018 at 01:33:05 UTC, Seb wrote: On Sunday, 4 February 2018 at 01:23:50 UTC, Rubn wrote: On Saturday, 3 February 2018 at 23:42:28 UTC, welkam wrote: [...] I think you have to build with an old version of MSVC,

Re: Interfacing with C++

2018-02-04 Thread Timothee Cour via Digitalmars-d-learn
Calypso (https://github.com/Syniurge/Calypso/) is the most promising way to interface with C++, it requires 0 bindings and understands all of C++ (templates etc); there are some caveats/kinks that are being ironed out (and any help is welcome). On Sun, Feb 4, 2018 at 4:37 AM, rjframe via

Re: Setting up DMD on windows

2018-02-04 Thread Rubn via Digitalmars-d-learn
On Sunday, 4 February 2018 at 01:33:05 UTC, Seb wrote: On Sunday, 4 February 2018 at 01:23:50 UTC, Rubn wrote: On Saturday, 3 February 2018 at 23:42:28 UTC, welkam wrote: [...] I think you have to build with an old version of MSVC, 2010 maybe? It's been a while since I built it I don't

Re: Should the "front" range primitive be "const" ?

2018-02-04 Thread Simen Kjærås via Digitalmars-d-learn
On Friday, 2 February 2018 at 14:29:34 UTC, H. S. Teoh wrote: Its semantics are not broken; it's just harder to use. Due to const transitivity, it's an all-or-nothing deal. .tailConst gives us the middle ground. If the semantics of const means that users will have to write .tailConst all

Re: Interfacing with C++

2018-02-04 Thread Seb via Digitalmars-d-learn
On Sunday, 4 February 2018 at 10:42:22 UTC, infinityplusb wrote: On Sunday, 4 February 2018 at 08:33:20 UTC, Mike Parker wrote: [...] it is, everyone keeps saying writing bindings in D is super easy ... I feel this is a slight simplification. :( [...] Sounds easy enough. [...] [...]

Re: How to convert hex string to string or ubytes? Thanks.

2018-02-04 Thread FrankLike via Digitalmars-d-learn
On Monday, 5 February 2018 at 06:12:22 UTC, H. S. Teoh wrote: On Mon, Feb 05, 2018 at 05:48:00AM +, FrankLike via auto input = "48656c6c6f20776f726c6421"; auto str = input.chunks(2) .map!(digits => cast(char) digits.to!ubyte(16))

How to convert hex string to string or ubytes? Thanks.

2018-02-04 Thread FrankLike via Digitalmars-d-learn
Now,I can get the string from hex string in compile time,but how to get it in run time? How to get it in run time? Thanks.

Re: How to convert hex string to string or ubytes? Thanks.

2018-02-04 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Feb 05, 2018 at 05:48:00AM +, FrankLike via Digitalmars-d-learn wrote: > Now,I can get the string from hex string in compile time,but how to > get it in run time? > > How to get it in run time? > > Thanks. import std.conv; string hex = "900D1DEA"; uint value

Re: How to convert hex string to string or ubytes? Thanks.

2018-02-04 Thread FrankLike via Digitalmars-d-learn
On Monday, 5 February 2018 at 06:12:22 UTC, H. S. Teoh wrote: On Mon, Feb 05, 2018 at 05:48:00AM +, FrankLike via assert(str == "Hello world!"); Thanks.very good!

Re: Getting compiler Segfault

2018-02-04 Thread H. S. Teoh via Digitalmars-d-learn
On Sun, Feb 04, 2018 at 12:52:22PM +, Ur@nuz via Digitalmars-d-learn wrote: > Getting compiler stack overflow when building my project, but still do > not know how to localize piece of code that triggers this bug. Maybe > this bug is already registered in bugzilla or someone could give some >

Re: How to convert hex string to string or ubytes? Thanks.

2018-02-04 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Feb 05, 2018 at 05:48:00AM +, FrankLike via Digitalmars-d-learn wrote: > Now,I can get the string from hex string in compile time,but how to > get it in run time? > > How to get it in run time? [...] Oh wait, I think I misunderstood your original question. Perhaps this is closer to

Re: Interfacing with C++

2018-02-04 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 4 February 2018 at 07:54:12 UTC, infinityplusb wrote: Hi all I'm looking to try and write an interface to C++, but given I'm a casual dabbler in D, it's slightly beyond my current ability in terms of both C++ and D! As a leg up, how would one translate something like this from

Re: Interfacing with C++

2018-02-04 Thread rikki cattermole via Digitalmars-d-learn
On 04/02/2018 7:54 AM, infinityplusb wrote: Hi all I'm looking to try and write an interface to C++, but given I'm a casual dabbler in D, it's slightly beyond my current ability in terms of both C++ and D! As a leg up, how would one translate something like this from C++ to D? `typedef int

Re: Interfacing with C++

2018-02-04 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 4 February 2018 at 08:17:31 UTC, Mike Parker wrote: So assuming CV_CDECL is cdecl, this should do it: extern(C) alias CvCmpFunc = int function(const(void)*, const(void)*, void*); Assuming this is OpenCV, Looking at [1], it's cdecl only on Windows. Empty everywhere else. So