October 14, 2015
On Tuesday, 13 October 2015 at 11:22:54 UTC, Marco Leise wrote:

>
> I was of the impression that you need to put the initialized field of a union first, but maybe I'm wrong. There is at least this in the documentation on struct literals: "If there are anonymous unions in the struct, only the first member of the anonymous union can be initialized with a struct literal, and all subsequent non-overlapping fields are default initialized."

You're correct in that only the first member of a union can be initialized. DMD will give you an error about "overlapping initialization" if you attempt to initialize a different member. However, it will allow you to do so if turn off default initialization for preceding members as in the Pastebin example.

union Foo {
    uint ui;
    float f = 2.0f;  //  Error: overlapping initialization for field f and ui
    double d;
}

union Bar {
    uint ui = void;    // This makes it OK
    float f = 2.0f;
    double d;
}

The pastebin example compiles, prints 256, and passes the assert with DMD 2.068.2. But I can't find any documentation on it anywhere.

October 16, 2015
Kai Nacke:

On Saturday, 10 October 2015 at 15:28:02 UTC, Kai Nacke wrote:
> On behalf of the LDC team I am proud to announce the LDC 0.16.0 beta2 release!

I have tried this one:

> ldc2-0.16.0-beta2-win64-msvc.zip

A default 64 bit Windows installation lacks the vcruntime140.dll and msvcp140.dll.

If you have those dlls in 64 bit versions and you compile, it says some syntax is wrong and stops with:

Error: ...\ldc2\bin\amd64.bat failed with status: 1

Bye,
bearophile
October 16, 2015
On Friday, 16 October 2015 at 09:50:08 UTC, bearophile wrote:
> A default 64 bit Windows installation lacks the vcruntime140.dll and msvcp140.dll.

LDC is linked dynamically against the MS C runtime, so you need the VS 2015 runtime. You'll actually need VS 2015 (not just the runtime) later for linking anyway; VS 2013 is only supported when building LDC yourself. This is mentioned in http://wiki.dlang.org/Latest_pre-built_LDC_for_Win64.

> If you have those dlls in 64 bit versions and you compile, it says some syntax is wrong and stops with:
>
> Error: ...\ldc2\bin\amd64.bat failed with status: 1

This is LDC issue #1152 (https://github.com/ldc-developers/ldc/issues/1152), which is fixed in master. You may just go ahead and download the latest CI build from https://github.com/ldc-developers/ldc/releases/tag/LDC-Win64-master.
October 16, 2015
On Friday, 16 October 2015 at 13:55:54 UTC, kinke wrote:
> On Friday, 16 October 2015 at 09:50:08 UTC, bearophile wrote:
>> A default 64 bit Windows installation lacks the vcruntime140.dll and msvcp140.dll.
>
> LDC is linked dynamically against the MS C runtime, so you need the VS 2015 runtime.

Wasn't it changed to universal runtime?
October 16, 2015
On Friday, 16 October 2015 at 15:15:16 UTC, Kagamin wrote:
> On Friday, 16 October 2015 at 13:55:54 UTC, kinke wrote:
>> On Friday, 16 October 2015 at 09:50:08 UTC, bearophile wrote:
>>> A default 64 bit Windows installation lacks the vcruntime140.dll and msvcp140.dll.
>>
>> LDC is linked dynamically against the MS C runtime, so you need the VS 2015 runtime.
>
> Wasn't it changed to universal runtime?

Afaik, they split it into a universal runtime (part of th e OS) and a Visual C(++) runtime.
October 16, 2015
kinke:

> so you need the VS 2015 runtime. You'll actually need VS 2015 (not just the runtime) later for linking anyway;

Is the "community" (free) version enough?

Bye,
bearophile
October 16, 2015
On Friday, 16 October 2015 at 19:01:12 UTC, bearophile wrote:
> kinke:
>
>> so you need the VS 2015 runtime. You'll actually need VS 2015 (not just the runtime) later for linking anyway;
>
> Is the "community" (free) version enough?
>
> Bye,
> bearophile

Yes VS 2015 Community has more or less the feature set of VS 2010-2013 Professional from previous years, but without some of the more advanced testing, architecture modeling tools and debugging. For example there is no longer the limitation about installing plugins and extensions like the Express version had.

It should have all the necessary libraries for linking under
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\ (for 32-bit) and
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\amd64\lib (for 64-bit)
or something like that.

For example if you want to link a D static library to a C++ program you can use the new support for VS 2015 CRT in DMD v2.069.0 beta like this:

[under VS2015 x86 Native Tools Command Prompt]
dmd -lib -m32mscoff my_d_library.d
cl /nologo my_cpp_program.cpp my_d_library.lib C:\D\dmd2\windows\lib32mscoff\phobos32mscoff.lib "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\legacy_stdio_definitions.lib"

I think it should work in a similar way for LDC.
October 17, 2015
On Friday, 16 October 2015 at 09:50:08 UTC, bearophile wrote:
> Kai Nacke:
>
> On Saturday, 10 October 2015 at 15:28:02 UTC, Kai Nacke wrote:
>> On behalf of the LDC team I am proud to announce the LDC 0.16.0 beta2 release!
>
> I have tried this one:
>
>> ldc2-0.16.0-beta2-win64-msvc.zip
>
> A default 64 bit Windows installation lacks the vcruntime140.dll and msvcp140.dll.
>
> If you have those dlls in 64 bit versions and you compile, it says some syntax is wrong and stops with:
>
> Error: ...\ldc2\bin\amd64.bat failed with status: 1
>
> Bye,
> bearophile

BTW, Welcome back.... bearophile!

;-P

---
Paolo
Next ›   Last »
1 2