<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div>Hi all,<br>I'm trying to link a c program to the ei library.<br>This seems not to work, I get linking errors:<br>undefined reference to XXXXX.<br><br>Platform is linux, erlang is compiled from otp_src_R12B-3<br><br>the test program:<br><br>#include <ei.h><br>#include <erl_interface.h><br><br>int<br>main(int argc, char** argv) {<br> ei_term et;<br> char buf [255];<br> int i = 0;<br> ei_decode_ei_term(buf, &i, &et);<br> return 0;<br>}<br><br>the compile commands:<br># no problems here:<br>gcc -Wall -ggdb -I/home/steffen/usr/lib/erlang/lib/erl_interface-3.5.7/include -c ltest.c <br>#linker problems:<br>gcc -L/home/steffen/usr/lib/erlang/lib/erl_interface-3.5.7/lib
-lei -lerl_interface ltest.o -o
ltest<br>>>/home/steffen/hacking/erl_link_tst/ltest.c:9: undefined reference to `ei_decode_ei_term'<<<br><br>the content of home/steffen/usr/lib/erlang/lib/erl_interface-3.5.7/lib:<br> ls -l /home/steffen/usr/lib/erlang/lib/erl_interface-3.5.7/lib<br>total 1856<br>-rw-r--r-- 1 steffen steffen 724286 2008-06-19 02:15 libei.a<br>-rw-r--r-- 1 steffen steffen 714258 2008-06-19 02:15 libei_st.a<br>-rw-r--r-- 1 steffen steffen 220266 2008-06-19 02:15 liberl_interface.a<br>-rw-r--r-- 1 steffen steffen 219330 2008-06-19 02:15 liberl_interface_st.a<br><br>thanks in advance for helpful hints<br><br>greetings steffen<br><br>ps:<br>I hope yahoo does not send this in html "format"<br><br></div></div></div><br>
</body></html>