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();
which I try to compile and run. But I get the following error:
$ dmd main.d -L-lhello
ld: library not found for -lhello
clang: error: linker command failed with exit code 1 (use -v to
see invocation)
--- errorlevel 1
I gather that mac os x doesn't know where to find
libhello.dylib (it is in the current directory). So how do I
pass that information?
Thanks!
TJB
Off the top of my head: does adding -L-L$(pwd) help?