Re: How can I serialize a struct into a file in the style of C?

2017-07-22 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 23 July 2017 at 02:07:45 UTC, solidstate1991 wrote: Well, it seems the toStringz() function adds a few garbage characters to the end of the filename How are you using it? The only character it should be adding is the zero terminator. I suspect you might be using it on a static

Re: How can I serialize a struct into a file in the style of C?

2017-07-22 Thread solidstate1991 via Digitalmars-d-learn
On Saturday, 22 July 2017 at 02:22:53 UTC, Mike Parker wrote: I should add, though, that you're better off using either std.stdio.File or std.file. Use the former if you need to make multiple reads/writes to a file, the latter if you can pull it in or push it out all in one go. They take

Re: GtkD on android?

2017-07-22 Thread Seb via Digitalmars-d-learn
On Saturday, 22 July 2017 at 18:59:44 UTC, FoxyBrown wrote: With LDC's new ability to do android/arm, we are missing the ability to do GUI's? Can any of the current D solutions work such as GtkD or QtD? I'm looking for something somewhat lightweight, easy to use(I find GtkD a bit funky but it

Best syntax for a diagonal and vertical slice

2017-07-22 Thread kerdemdemir via Digitalmars-d-learn
We have awesome way for creating slices like: a = new int[5]; int[] b = a[0..2]; But what about if I have 2D array and I don't want to go vertical. Something like : int[3][3] matrix = [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ]; I believe I can use std.range function

GtkD on android?

2017-07-22 Thread FoxyBrown via Digitalmars-d-learn
With LDC's new ability to do android/arm, we are missing the ability to do GUI's? Can any of the current D solutions work such as GtkD or QtD? I'm looking for something somewhat lightweight, easy to use(I find GtkD a bit funky but it does seem to work and is relatively easy once one gets

Re: unresolved external symbol error (How to resolve?)

2017-07-22 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 22 July 2017 at 18:04:41 UTC, WhatMeWorry wrote: And what do the _ModuleInfoZs mean? You didn't compile in all your modules. Try adding each one to the dmd command line.

unresolved external symbol error (How to resolve?)

2017-07-22 Thread WhatMeWorry via Digitalmars-d-learn
Linking... 01_06_coord_systems.obj : error LNK2001: unresolved external symbol _D11common_game12__ModuleInfoZ 01_06_coord_systems.obj : error LNK2001: unresolved external symbol _D14post_processor12__ModuleInfoZ I've gotten plenty of undefined external symbol errors in my time but how does

Re: Cannot find std.datetime when linking after upgrade to 2.075.0

2017-07-22 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, July 22, 2017 15:29:26 Domain via Digitalmars-d-learn wrote: > On Friday, 21 July 2017 at 19:05:00 UTC, Jonathan M Davis wrote: > > On Friday, July 21, 2017 15:33:45 Domain via > > > > Digitalmars-d-learn wrote: > >> After upgrade dmd to latest 2.075.0, my project no longer > >>

Re: Cannot find std.datetime when linking after upgrade to 2.075.0

2017-07-22 Thread Domain via Digitalmars-d-learn
On Friday, 21 July 2017 at 19:05:00 UTC, Jonathan M Davis wrote: On Friday, July 21, 2017 15:33:45 Domain via Digitalmars-d-learn wrote: After upgrade dmd to latest 2.075.0, my project no longer build: zero.lib(core_cde_4a4f.obj) : error LNK2001: unresolved external symbol _D3std8d

Re: Cannot find std.datetime when linking after upgrade to 2.075.0

2017-07-22 Thread Domain via Digitalmars-d-learn
On Friday, 21 July 2017 at 19:05:00 UTC, Jonathan M Davis wrote: On Friday, July 21, 2017 15:33:45 Domain via Digitalmars-d-learn wrote: After upgrade dmd to latest 2.075.0, my project no longer build: zero.lib(core_cde_4a4f.obj) : error LNK2001: unresolved external symbol _D3std8d

Re: Creating a new type, to get strong-ish type checking and restrict usage to certain operations, using struct perhaps

2017-07-22 Thread Moritz Maxeiner via Digitalmars-d-learn
On Saturday, 22 July 2017 at 06:08:59 UTC, Cecil Ward wrote: On Saturday, 22 July 2017 at 03:18:29 UTC, Cecil Ward wrote: [...] I saw David Nadlinger's units package. I'd like to know how the strong typing works. By wrapping in structs and overloading operators [1][2][3][4]. [1]

Re: Creating a new type, to get strong-ish type checking and restrict usage to certain operations, using struct perhaps

2017-07-22 Thread Moritz Maxeiner via Digitalmars-d-learn
On Saturday, 22 July 2017 at 03:18:29 UTC, Cecil Ward wrote: I guess part of my question, which I didn't really highlight well enough, is the issue of strong typing. [...] Going back to the original example of packed bcd stored in a uint64_t say, first thing is that I want to ban illegal

Re: Creating a new type, to get strong-ish type checking and restrict usage to certain operations, using struct perhaps

2017-07-22 Thread Cecil Ward via Digitalmars-d-learn
On Saturday, 22 July 2017 at 03:18:29 UTC, Cecil Ward wrote: [...] I saw David Nadlinger's units package. I'd like to know how the strong typing works.