The Erl_Interface documentation code appears not to work

I have zero experience with erl_interface or nix, but the example about linking executables with ld is just plain wrong. Unless you know exactly what you’re doing and how everything fits together, you should use your compiler to link your executables, not ld. In this case that would be:

cc -o main main.o -L$ERL_INTERFACE/lib -lei

For starters, the ld invocation totally fails to include libc or C start-up files, or selecting the correct linker map. cc does handle these things.

4 Likes