[erlang-questions] A simple NIF so: compiles on Ubuntu, but not on MacOSX. Is something missing?

Ivan Uemlianin <>
Tue Jun 28 12:16:57 CEST 2011


Dear All

I'm writing a simple NIF.  This is what I'm using to compile it:

gcc -Wall  \
     -I/usr/local/lib/erlang/usr/include  \
     -fPIC  \
     -shared \
     -o simple_nif.so  \
     simple.c simple_nif.c

This compiles on Ubuntu, but trying it on a Mac I get this error:

> Undefined symbols:
>   "_enif_make_badarg", referenced from:
>       _get_params_nif in ccNKt95s.o
>   "_enif_make_tuple_from_array", referenced from:
>       _get_params_nif in ccNKt95s.o
>   "_enif_make_int", referenced from:
>       _get_params_nif in ccNKt95s.o
>   "_enif_get_tuple", referenced from:
>       _get_params_nif in ccNKt95s.o
> ld: symbol(s) not found
> collect2: ld returned 1 exit status

Both machines are running erlang 14B, installed from source (the -I path 
is the same for both).  I don't have my Ubuntu machine with me atm, but 
this is what's in .../usr/include on the Mac:

> $ l /usr/local/lib/erlang/usr/include/
>
> driver_int.h
> erl_driver.h
> erl_drv_nif.h
> erl_fixed_size_int_types.h
> erl_int_sizes_config.h
> erl_memory_trace_parser.h
> erl_nif.h
> erl_nif_api_funcs.h

Is something missing?  Does the Mac need extra arguments to compile?

With thanks and best wishes

Ivan


-- 
============================================================
Ivan A. Uemlianin
Speech Technology Research and Development

                     
                      www.llaisdy.com
                          llaisdy.wordpress.com
                      www.linkedin.com/in/ivanuemlianin

     "Froh, froh! Wie seine Sonnen, seine Sonnen fliegen"
                      (Schiller, Beethoven)
============================================================



More information about the erlang-questions mailing list