[erlang-questions] Problems with C Erlang interface

J Bhanot <>
Wed Jan 30 13:09:43 CET 2008


Hi Tomas,

I tried following:

[ otp_src_R12B-0]# 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

got the following error -

/tmp/ccAvr8jd.o: In function `main':
test.c:(.text+0x28): undefined reference to `erl_init'
collect2: ld returned 1 exit status
[ otp_src_R12B-0]#


then i tried:

[ otp_src_R12B-0]# 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

got the following error:

cc: /topi: No such file or directory
[ otp_src_R12B-0]#

Also, i tried 

[ otp_src_R12B-0]# ld 
-L/usr/local/lib/erlang/lib/erl_interface-3.5.5.3/lib test.o 
-lerl_interface -lei -lpthread -o test

ld: warning: cannot find entry symbol _start; defaulting to 08049220
[ otp_src_R12B-0]#

only a  warning during that but when i execute the executable

[ otp_src_R12B-0]# ./test
bash: ./test: /usr/lib/libc.so.1: bad ELF interpreter: No such file or 
directory
[ otp_src_R12B-0]#

Any ideas on that...

Thanks,

jb





Tomas Pihl <> 
01/30/2008 02:32 PM

To
J Bhanot <>
cc

Subject
Re: [erlang-questions] Problems with C Erlang interface






* 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

ForwardSourceID:NT0000DFBE 
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080130/ea822bab/attachment.html>


More information about the erlang-questions mailing list