[erlang-questions] Problems with C Erlang interface

Tomas Pihl <>
Wed Jan 30 10:02:34 CET 2008


* J Bhanot <> [2008-01-30 11:31:47 +0530]:

> Hi, 
> 
> I created a C file test.c
> 
> {code}
> 
> #include "erl_interface.h" 
> #include "ei.h" 
> #include <stdio.h>
> 
> main() 
> { 
> int i=2; 
> erl_init(NULL,0); 
> }
> 
> {/code}
> 
> 
> Compiled it as follows : 
> cc -c -I/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/include test.c 
> No errors in compiling
> 
> Tried to link it as follows:
> ld -L/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/lib test.o 
> -lerl_interface -lei -o test 
> but during liking, I got tons of errrs
> 

Try

cc -o test -I/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/include \
-L/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/lib -lerl_interface \
-lei test.c

 /topi



More information about the erlang-questions mailing list