On Saturday, 19 August 2023 at 22:53:53 UTC, Sergey wrote:
On Saturday, 19 August 2023 at 21:35:25 UTC, Alexander wrote:
Completely new to D, and when trying to setup the toolchain,

Could you please specify the versions of macOS and DMD?
Probably DMD is broken for macOS - could you try to use LDC?

Maybe this thread is relative to the problem: https://github.com/ldc-developers/ldc/issues/3864

Thanks for the advice: I have installed dmd, dub, and now ldc with brew. Versions below:

% dmd --version
```
DMD64 D Compiler v2.105.0

Copyright (C) 1999-2023 by The D Language Foundation, All Rights Reserved written by Walter Bright
```
% dub --version
```
DUB version 1.34.0, built on Aug  1 2023
pacs@PACS-2019-MBPRO ~ % sw_vers
ProductName:            macOS
ProductVersion:         13.5
BuildVersion:           22G74
```
% ldc2 --version
```
LDC - the LLVM D compiler (1.33.0):
  based on DMD v2.103.1 and LLVM 15.0.7
  built with LDC - the LLVM D compiler (1.28.1)
  Default target: x86_64-apple-darwin22.6.0
  Host CPU: skylake
  http://dlang.org - http://wiki.dlang.org/LDC

  Registered Targets:
  ...
```
% cat ~/.dub/settings.json
```
{
        "defaultArchitecture": "x86_64",
        "defaultCompiler": "ldc2"
}
```
(where defaultCompiler had been dmd before).

% dub run
```
    Starting Performing "debug" build using ldc2 for x86_64.
Up-to-date hellod ~master: target for configuration [application] is up to date. Finished To force a rebuild of up-to-date targets, run again with --force
     Running hellod
Edit source/app.d to start your project.
```

So, ldc2 seems to work with dub, where dmd did not. The odd thing though is, if you refer to my original post, is that I was able to build successfully by directly invoking dmd.

Reply via email to