Making a D library for a C executable

Jan Allersma janallersma at gmail.com
Fri Apr 28 12:24:44 UTC 2023


On Thursday, 27 April 2023 at 21:34:17 UTC, Steven Schveighoffer 
wrote:
> Also, please include your commands for building the D library 
> so reproduction is possible.
>
> -Steve

I used to `dub run` to solve the problem, nothing special. My 
`dub.json` isn't that interesting either, but I'll show it anyway 
for the sake of reproduction purposes:

```json
{
         "authors": [
                 "Jan Allersma"
         ],
         "copyright": "Copyright © 2023, Jan Allersma",
         "dependencies": {
                 "d2sqlite3": "~>1.0.0",
                 "secured": "~>2.0.2"
         },
         "description": "A minimal D application.",
         "license": "proprietary",
         "name": "shared-api",
         "targetType": "dynamicLibrary",
         "targetPath": "../build"
}
```

For people that use a Linux machine and don't have experience 
with using shared libraries just like me: Don't forget to add 
your shared library to a library path (e.g. `/usr/local/lib`). 
And just to be sure, I also executed `ldconfig` in Bash.


More information about the Digitalmars-d-learn mailing list