5HT / eslang

Erlang S-Lang Binding
1 stars 6 forks source link

Unable to compile (on Mac) --- ld: library not found for -lslang #4

Open llaisdy opened 9 years ago

llaisdy commented 9 years ago

Hello

After installing slang as specified (on a Mac), rebar compile fails like this:

$ rebar compile
==> eslang (compile)
cc -Wall -fPIC -I/usr/local/lib/erlang/erts-6.2/include -I/src   -c -o slang_drv.o slang_drv.c
slang_drv.c:8:10: fatal error: 'slang.h' file not found
#include <slang.h>
         ^
1 error generated.
make: *** [slang_drv.o] Error 1
ERROR: Command [compile] failed!

Adding -I/usr/include to CPPFLAGS in c_src/Makefile gets over this hurdle.

Now rebar compile fails like this:

$ rebar compile
==> eslang (compile)
cc -shared /usr/lib/libslang.a -fpic -lslang -flat_namespace -undefined suppress  -L"/usr/local/lib/erlang/lib/erl_interface-3.7.19/lib" -lerl_interface -lei -o ../priv/eslang_drv.so slang_drv.o
ld: library not found for -lslang
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [../priv/eslang_drv.so] Error 1
ERROR: Command [compile] failed!

I haven't been able to get past this one. /usr/lib/libslang.a is there. No amount of fiddling with c_src/Makefile or rebar.config has budged this. Can you help?

Thanks

Ivan

5HT commented 9 years ago

try

 brew install slang
llaisdy commented 9 years ago

Don't have homebrew. What is the configure/make/install not providing?

5HT commented 9 years ago

it depends on compiled C library slang, there is no ONE way you can add it. you could install it manually. Did you make it (if you dislike brew)?:

$ curl ftp://ftp.fu-berlin.de/pub/unix/misc/slang/v2.2/slang-2.2.4.tar.gz | tar xzf -
$ ./configure --prefix=/usr
$ make static
$ sudo make install-static

That instruction was taken from README.md