Linking D Runtime

2019-08-23 Thread Jonathan Levi via Digitalmars-d-learn
I am trying to find the D runtime/standard-library object(.o)/library(.a) files inorder to link them with some foreign code (Haskell as it happens). I am writing a program in Haskell but want to use D for some of the imperative style logic. I expect to have a large section of code in D so I

Re: Linking D Runtime

2019-08-23 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Aug 24, 2019 at 12:26:43AM +, Jonathan Levi via Digitalmars-d-learn wrote: > I am trying to find the D runtime/standard-library > object(.o)/library(.a) files inorder to link them with some foreign > code (Haskell as it happens). > > I am writing a program in Haskell but want to use D

Re: Linking D Runtime

2019-08-23 Thread Jonathan Levi via Digitalmars-d-learn
On Saturday, 24 August 2019 at 01:19:01 UTC, H. S. Teoh wrote: Not sure what's the "right" approach, but you could try compiling with dmd -v to find the path(s) to the runtime libraries that you'll need to link. Oh, cool, I managed to find them on my current system. I would love a more porta

Re: Linking D Runtime

2019-09-02 Thread Jonathan Levi via Digitalmars-d-learn
On Saturday, 24 August 2019 at 00:26:43 UTC, Jonathan Levi wrote: I am trying to find the D runtime/standard-library object(.o)/library(.a) files inorder to link them with some foreign code (Haskell as it happens). I am writing a program in Haskell but want to use D for some of the imperative

Re: Linking D Runtime

2019-09-03 Thread sarn via Digitalmars-d-learn
On Saturday, 24 August 2019 at 02:10:19 UTC, Jonathan Levi wrote: I would love a more portable solution though. This should work for now. How are you building the D code? It should be possible to build a library (with -lib and/or -shared) that statically includes the runtime and Phobos. I

Re: Linking D Runtime

2019-09-03 Thread Jacob Carlborg via Digitalmars-d-learn
On 2019-09-03 10:43, Jacob Carlborg wrote: This depends on how the compiler is installed. There are several installers that do not put the libraries in `/usr/lib`. BTW, that directory doesn't exist by default anymore on macOS, even if Xcode and the command line tools are installed. My bad. "

Re: Linking D Runtime

2019-09-03 Thread Jacob Carlborg via Digitalmars-d-learn
On 2019-09-03 03:45, Jonathan Levi wrote: It looks like what needs to be found are "libphobos2" and "libdruntime".  They can be found where ever your system puts lib files.  Windows (as far as I know) does not have a joined place for lib files so you need to look where dmd/ldc/etc installed it