Unable to compile GtkD on windows

2017-11-15 Thread user via Digitalmars-d-learn
I tried compiling GtkD, I get the error message: rdmd Build.d Error: more than 32767 symbols in object file 1. How to work around this? 2. Is D still unfriendly to newbies? I am disappoint :-( Using: DMD 2.077 GtkD 3.7.1 gtk3-runtime_3.22.24-1, 32bit

.LIB pagesize exceeds 512

2017-12-10 Thread user via Digitalmars-d-learn
Could someone please list some workarounds? I am trying to compile a demo app from gtkd. I tried compiling gtkd using dub with --build=plain option and still got that error when compiling the demo app. Using the latest dmd. Thanks in advance.

Re: .LIB pagesize exceeds 512

2017-12-10 Thread user via Digitalmars-d-learn
On Sunday, 10 December 2017 at 21:51:37 UTC, Mike Wey wrote: On 10-12-17 16:57, user wrote: Could someone please list some workarounds? I am trying to compile a demo app from gtkd. I tried compiling gtkd using dub with --build=plain option and still got that error when compiling the demo app.

Re: exporting function from betterc to windows dll

2020-03-14 Thread User via Digitalmars-d-learn
On Saturday, 14 March 2020 at 20:53:45 UTC, Abby wrote: I would like to export some functions from my bettec dll for dotnet core application in windows. [...] It is the calling convention.

Convert program to 2020: replace foreach loop with map, filter and friends

2020-03-30 Thread User via Digitalmars-d-learn
I'd like to convert the following program to 2020 standards (i.e, replace the foreach block with a one-line code). I've tried much and I failed. This is the code that works (1990s style) -- import std; void main() { immutable URL = r"https://raw.githubusercontent.com/CSSEGISandData/COVID

Re: Downloading files over TLS

2020-06-26 Thread User via Digitalmars-d-learn
On Friday, 26 June 2020 at 10:12:09 UTC, Jacob Carlborg wrote: Windows: I don't know that much of this platform. * std.net.curl and basically all other options already mentioned relies on OpenSSL, which is not provided by the platform * SChannel. As far as I know, this the the platform prov

SysTime comparesin - dropMiliseconds

2018-08-12 Thread User via Digitalmars-d-learn
I have to synchronize a directory. If remote file is newer I copy to local. If local file is newer I copy it to remote server. For some reason remote timestamp does not contain milliseconds, so comparison (localFileTime < remoteFileTime, etc) fails. I need help to drop milliseconds from local f

Re: SysTime comparesin - dropMiliseconds

2018-08-12 Thread User via Digitalmars-d-learn
On Sunday, 12 August 2018 at 19:50:44 UTC, User wrote: I have to synchronize a directory. If remote file is newer I copy to local. If local file is newer I copy it to remote server. For some reason remote timestamp does not contain milliseconds, so comparison (localFileTime < remoteFileTime, e

Re: signbit question

2018-03-15 Thread Dlang User via Digitalmars-d-learn
On 3/15/2018 12:39 PM, Miguel L wrote: On Thursday, 15 March 2018 at 17:31:38 UTC, rumbu wrote: On Thursday, 15 March 2018 at 17:18:08 UTC, Miguel L wrote: On Thursday, 15 March 2018 at 16:31:56 UTC, Stefan Koch wrote: On Thursday, 15 March 2018 at 15:28:16 UTC, Miguel L wrote: [...] intege

Re: property += operator

2018-05-10 Thread Dlang User via Digitalmars-d-learn
On 5/10/2018 1:43 PM, SrMordred wrote: struct T {     int x;     @property ref X(){ return x; }     @property X(int v)     {     x = v;     } } T t; t.X += 10; The setter 'x = v' are not executed because i´m returning the reference of x. And without the 'ref' the compiler complains

Re: property += operator

2018-05-10 Thread Dlang User via Digitalmars-d-learn
On 5/10/2018 2:50 PM, SrMordred wrote: On Thursday, 10 May 2018 at 19:41:41 UTC, Dlang User wrote: On 5/10/2018 1:43 PM, SrMordred wrote: [...] I am relatively new to D and I was under the impression that that was a limitation of @property functions. But, re-reading the language reference,

Re: property += operator

2018-05-10 Thread Dlang User via Digitalmars-d-learn
On 5/10/2018 3:18 PM, Ali Çehreli wrote: On 05/10/2018 01:03 PM, Dlang User wrote: >> this didn´t work either. >> note that 'f.data+= 2;' don't call the write property > > That's odd, it works on my machine (Windows 10 with V2.079.0 DMD compiler). Try putting writeln expressions in the tw

Re: Deleting a file with extsion *.FIFO in Windows

2018-06-01 Thread Dlang User via Digitalmars-d-learn
On 6/1/2018 12:06 AM, vino.B wrote: On Thursday, 24 May 2018 at 11:31:15 UTC, bauss wrote: On Thursday, 24 May 2018 at 06:59:47 UTC, Vino wrote: Hi All,   Request your help on how to delete a file which has the extension .fifo (.javast.fifo) in Windows. From, Vino.B What exactly is your i

fPIC Error

2016-11-02 Thread Dlang User via Digitalmars-d-learn
I am running Debian Testing and I think I have run into the recent fPIC issue. This is the source code for the test project I am using: import std.stdio; void main() { writeln("Edit source/app.d to start your project."); readln(); } When I try to compile a project, I get the

Re: fPIC Error

2016-11-03 Thread dlang user via Digitalmars-d-learn
On Thursday, 3 November 2016 at 06:11:48 UTC, rikki cattermole wrote: Took me a while to replicate your build environment but it looks like a false alarm. rikki@debian:/tmp/test$ dmd test.d rikki@debian:/tmp/test$ file test test: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamica

Re: structs inheriting from and implementing interfaces

2017-12-29 Thread Random D user via Digitalmars-d-learn
On Friday, 29 December 2017 at 12:03:59 UTC, Mike Franklin wrote: In C#, structs can inherit from and implement interfaces. Is that simply because it hasn't been implemented or suggested yet for D, or was there a deliberate design decision? Thanks for your insight, Mike I think it's deliber

How to detect/filter modules in __traits(allMembers)?

2016-06-11 Thread Random D user via Digitalmars-d-learn
Any good ideas how to do that? I couldn't figure it out in a short amount of time, but I expect that it's possible. I'm probably missing something obvious here. Probably because D's reflection/meta programming facilities are a bit all over the place (and unnecessarily convoluted IMO). Also I'm

Re: How to detect/filter modules in __traits(allMembers)?

2016-06-12 Thread Random D user via Digitalmars-d-learn
On Saturday, 11 June 2016 at 20:30:47 UTC, Basile B. wrote: On Saturday, 11 June 2016 at 19:45:56 UTC, Random D user wrote: Any good ideas how to do that? I couldn't figure it out in a short amount of time, but I expect that it's possible. I'm probably missing something obvious here. Probably

Why can't I init a new var from const var?

2017-02-11 Thread Random D user via Digitalmars-d-learn
I can init a variable from mutable source without defining any constructor or assignment operators, but not if the source is const. I would imagine the behavior to be the same with mutable and const source, since it's just reading the source and copying it. Is there a reason for this? Or is t

I think is a bug?

2017-03-11 Thread Random D user via Digitalmars-d-learn
int*[] foo; foo.length = 5; import std.c.string; int* baz = cast(string*)malloc(50); import std.c.stdio; printf("%d %d", foo.length, baz.length ); prints: Error: no property 'length' for type 'int*' BUT: string*[] foo; foo.length = 5; import std.c.string; string* baz = cast(string*)malloc(50

Re: I think is a bug?

2017-03-11 Thread Random D user via Digitalmars-d-learn
On Sunday, 12 March 2017 at 01:55:20 UTC, ketmar wrote: Random D user wrote: How come string* suddenly has a .length property? due to automatic pointer dereferencing that `.` does. no, not a bug. Ah... right. Silly me. Of course, since string is actually immutable(char)[]. That's bit of a

I had a bad time with slice-in-struct array operation forwarding/mimicing. What's the best way to do it?

2019-05-04 Thread Random D user via Digitalmars-d-learn
I wanted to make a 2D array like structure and support D slice like operations, but I had surprisingly bad experience. I quickly copy pasted the example from the docs: https://dlang.org/spec/operatoroverloading.html#array-ops It's something like this: struct Array2D(E) { E[] impl; int

Re: I had a bad time with slice-in-struct array operation forwarding/mimicing. What's the best way to do it?

2019-05-09 Thread Random D user via Digitalmars-d-learn
On Saturday, 4 May 2019 at 16:10:36 UTC, Adam D. Ruppe wrote: On Saturday, 4 May 2019 at 15:18:58 UTC, Random D user wrote: But array copy and setting/clearing doesn't: int[] bar = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ]; foo[] = bar[]; Generally speaking, opIndex is for getti

Re: I had a bad time with slice-in-struct array operation forwarding/mimicing. What's the best way to do it?

2019-05-09 Thread Random D user via Digitalmars-d-learn
On Saturday, 4 May 2019 at 15:36:51 UTC, Nicholas Wilson wrote: On Saturday, 4 May 2019 at 15:18:58 UTC, Random D user wrote: I wanted to make a 2D array like structure and support D slice like operations, but I had surprisingly bad experience. The de facto multi dimensional array type in D i

I guess this is a bug?

2015-09-12 Thread Random D user via Digitalmars-d-learn
or is it some obscure feature conflict? struct Foo { this( float x_, float y_ ) { // option A //x = x_; //y = y_; // option B v[0] = x_; v[1] = y_; } union { struct { float x = 0; float y

Re: I guess this is a bug?

2015-09-12 Thread Random D user via Digitalmars-d-learn
On Saturday, 12 September 2015 at 18:28:02 UTC, Random D user wrote: or is it some obscure feature conflict? [...] Oh... and I'm using win 64-bit and dmd 2.068.1, but this behavior was present earlier than that...

Another, is it a bug?

2015-09-15 Thread Random D user via Digitalmars-d-learn
I'm trying to make a base class with get property and a sub class with corresponding set property. The value for the base class is set via constructor. The intuitive way doesn't seem to work and workarounds are unnecessarily ugly (considering you'll sprinkle them all over the codebase). class

Re: Another, is it a bug?

2015-09-15 Thread Random D user via Digitalmars-d-learn
On Wednesday, 16 September 2015 at 03:17:05 UTC, Meta wrote: Considering Father defines the function `int eat()` and Daughter defines the completely different function `int eat(int)`, it doesn't surprise me. You're not using virtual dispatch when you do `return super.eat` or `d.Father.eat()`,

Re: Another, is it a bug?

2015-09-15 Thread Random D user via Digitalmars-d-learn
On Wednesday, 16 September 2015 at 03:54:34 UTC, Adam D. Ruppe wrote: On Wednesday, 16 September 2015 at 03:48:59 UTC, Random D user Given that, normally properties are just overloaded methods in D, it's pretty sad classes break this behavior/convention. The D behavior for overloading is diffe

Tried release build got ICE, does anyone have a clue what might cause this?

2015-09-18 Thread Random D user via Digitalmars-d-learn
So I tried to build my project in release for the first time in a long while. It takes like 25x longer to compile and finally the compiler crashes. It seems to go away if I disable the optimizer. I get: tym = x1d Internal error: backend\cgxmm.c 547 Does anyone have a clue what might trigger th

Re: Tried release build got ICE, does anyone have a clue what might cause this?

2015-09-19 Thread Random D user via Digitalmars-d-learn
On Saturday, 19 September 2015 at 07:25:58 UTC, ponce wrote: On Friday, 18 September 2015 at 22:54:43 UTC, Random D user wrote: So I tried to build my project in release for the first time in a long while. It takes like 25x longer to compile and finally the compiler crashes. It seems to go away

Re: Tried release build got ICE, does anyone have a clue what might cause this?

2015-09-19 Thread Random D user via Digitalmars-d-learn
On Saturday, 19 September 2015 at 21:48:25 UTC, Random D user wrote: Assertion failure: 'type->ty != Tstruct || ((TypeStruct *)type)->sym == this' on line 957 in file 'struct.c' Ok managed to reduce this one to my own copy paste bug. This is invalid code, but compiler shouldn't crash... I'm

Builtin array and AA efficiency questions

2015-10-15 Thread Random D user via Digitalmars-d-learn
So I was doing some optimizations and I came up with couple basic questions... A) What does assumeSafeAppend actually do? A.1) Should I call it always if before setting length if I want to have assumeSafeAppend semantics? (e.g. I don't know if it's called just before the function I'm in) A.2)

Re: Builtin array and AA efficiency questions

2015-10-15 Thread Random D user via Digitalmars-d-learn
Thanks for thorough answer. On Thursday, 15 October 2015 at 18:46:22 UTC, H. S. Teoh wrote: It adjusts the size of the allocated block in the GC so that subsequent appends will not reallocate. So how does capacity affect this? I mean what is exactly a GC block here. Shrink to fit bit wa

Re: Builtin array and AA efficiency questions

2015-10-15 Thread Random D user via Digitalmars-d-learn
Ah missed your post before replying to H.S. Teoh (I should refresh more often). Thanks for reply. On Thursday, 15 October 2015 at 19:50:27 UTC, Steven Schveighoffer wrote: Without more context, I would say no. assumeSafeAppend is an assumption, and therefore unsafe. If you don't know what is

AA struct hashing bug?

2015-12-07 Thread Random D user via Digitalmars-d-learn
struct Foo { this( int k ) { a = k; } int a; } Foo foo; int[ Foo ] map; map[ foo ] = 1; // Crash! bug? // This also crashes. I believe crash above makes a call like this (or similar) in the rt. //auto h = typeid( foo ).getHash( &foo ); // Crash! win64 & dmd 2.69.2

How to make a transparent wrapper type?

2015-12-07 Thread Random D user via Digitalmars-d-learn
I kind of miss reference values on stack, so I attempted to make one in a struct. Pointers are pretty good (since d doesn't have ->), but it would be nice to avoid dereferencing them explicitly on assignment. Since reference is a pointer that you can't change afterwards. I tried something like

Re: How to make a transparent wrapper type?

2015-12-08 Thread Random D user via Digitalmars-d-learn
On Monday, 7 December 2015 at 20:03:07 UTC, Namespace wrote: This seems to work: struct RefVal(T) { private T* ptr; this(T* val) { ptr = val; } ref auto opAssign(U)(auto ref U value) { *ptr = value;

Re: How to make a transparent wrapper type?

2015-12-08 Thread Random D user via Digitalmars-d-learn
On Tuesday, 8 December 2015 at 10:26:18 UTC, Random D user wrote: On Monday, 7 December 2015 at 20:03:07 UTC, Namespace wrote: This seems to work: struct RefVal(T) { private T* ptr; this(T* val) { ptr = val; } ref auto opAssign(U)(au

Re: AA struct hashing bug?

2015-12-08 Thread Random D user via Digitalmars-d-learn
On Tuesday, 8 December 2015 at 01:23:40 UTC, Ivan Kazmenko wrote: On Monday, 7 December 2015 at 22:03:42 UTC, Alex Parrill wrote: On Monday, 7 December 2015 at 18:48:18 UTC, Random D user Tested the same code with -m32 and -m64 on Windows. Works for me, too. I tried this again. And it seems

Re: AA struct hashing bug?

2015-12-08 Thread Random D user via Digitalmars-d-learn
On Tuesday, 8 December 2015 at 11:04:49 UTC, Random D user wrote: I need to look into this more. Ok. This is minimal app that crashes for me. If someone could try this: class App { this() { } void crash( int val ) in { assert( val == 1 ); } body {