Re: Linking to Dynamic Library on Mac OS X

2015-05-16 Thread TJB via Digitalmars-d-learn
On Friday, 15 May 2015 at 19:49:30 UTC, John Colvin wrote: On Friday, 15 May 2015 at 19:39:53 UTC, TJB wrote: Off the top of my head: does adding -L-L$(pwd) help? This is what I get: $ dmd main.d -L-L$(pwd) -lhello Error: unrecognized switch '-lhello' Sorry if this is completely elementary

Re: Linking to Dynamic Library on Mac OS X

2015-05-16 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-05-15 21:49, John Colvin wrote: Note that you may also find you need to help OS X find the dylib when running the program, either by moving it to one of the system locations or using DYLD_LIBRARY_PATH or DYLD_FALLBACK_LIBRARY_PATH That should not be necessary. -- /Jacob Carlborg

Re: Linking to Dynamic Library on Mac OS X

2015-05-15 Thread John Colvin via Digitalmars-d-learn
On Friday, 15 May 2015 at 03:33:47 UTC, TJB wrote: I have built a toy dynamic shared library on Mac OS X (in C), and I have verified that it works from C. Now I would like to call it from D. So I have created the following interface file: $ cat hello.di extern (C): void printHelloWorld();

Re: Linking to Dynamic Library on Mac OS X

2015-05-15 Thread TJB via Digitalmars-d-learn
Off the top of my head: does adding -L-L$(pwd) help? This is what I get: $ dmd main.d -L-L$(pwd) -lhello Error: unrecognized switch '-lhello' Sorry if this is completely elementary and I am being quite dumb. Thanks, TJB

Re: Linking to Dynamic Library on Mac OS X

2015-05-15 Thread John Colvin via Digitalmars-d-learn
On Friday, 15 May 2015 at 19:39:53 UTC, TJB wrote: Off the top of my head: does adding -L-L$(pwd) help? This is what I get: $ dmd main.d -L-L$(pwd) -lhello Error: unrecognized switch '-lhello' Sorry if this is completely elementary and I am being quite dumb. Thanks, TJB should be $ dmd

Linking to Dynamic Library on Mac OS X

2015-05-14 Thread TJB via Digitalmars-d-learn
I have built a toy dynamic shared library on Mac OS X (in C), and I have verified that it works from C. Now I would like to call it from D. So I have created the following interface file: $ cat hello.di extern (C): void printHelloWorld(); which I try to compile and run. But I get the