Including C sources in a DUB project

Alexander Zhirov azhirov1991 at gmail.com
Wed May 11 05:11:10 UTC 2022


On Tuesday, 10 May 2022 at 22:12:52 UTC, Dennis wrote:
> It depends on whether your DMD or LDC installation comes first 
> in your PATH environment variable. Both ship with a `dub` 
> executable that uses their compiler as default.

I came across something else like this. Created a 
`dub.settings.json` file in the dub project, but still requires 
`dmd`:

```sh
$ dub
Performing "debug" build using dmd for x86_64.
app ~master: building configuration "application"...
Running pre-build commands...
Error: unrecognized switch '-Os'
        run `dmd` to print the compiler manual
        run `dmd -man` to open browser on manual
dmd failed with exit code 1.
```

*dub.settings.json*:

```js
{
	"defaultArchitecture": "x86_64",
	"defaultCompiler": "ldc"
}
```


More information about the Digitalmars-d-learn mailing list