Re: D: How would one make a shared dynamically linked D library?

2023-11-09 Thread IchorDev via Digitalmars-d-learn
On Wednesday, 8 November 2023 at 11:48:58 UTC, BoQsc wrote: I would like to export some functionality as external shared dynamically linked D library. Is it possible to do that in D Language Yes, as long as the symbols you want to use externally are `public`, which is the default. When it co

Re: D: How would one make a shared dynamically linked D library?

2023-11-08 Thread Hipreme via Digitalmars-d-learn
On Wednesday, 8 November 2023 at 11:48:58 UTC, BoQsc wrote: I would like to export some functionality as external shared dynamically linked D library. Is it possible to do that in D Language and what are limitations? A simple `writeln` example would be great. What I expect is an executable

Re: D: How would one make a shared dynamically linked D library?

2023-11-08 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
Currently stick to ldc. Dub's defaults will "just work" except: - On *nix where you have to either set/patch the ``RPATH`` or set ``LD_LIBRARY_PATH``. - For executables on Windows in which you need to set the dflag ``-dllimport=all``. From a README of mine (for Posix): To get the loading

D: How would one make a shared dynamically linked D library?

2023-11-08 Thread BoQsc via Digitalmars-d-learn
I would like to export some functionality as external shared dynamically linked D library. Is it possible to do that in D Language and what are limitations? A simple `writeln` example would be great. What I expect is an executable that uses functions, variables, classes, modules from compiled