[erlang-questions] 答复: Questions about how to link erl_interface.lib?

._ yelt@REDACTED
Mon Nov 17 15:13:47 CET 2014


Hi Serge Jurecko£¬

         Thank you very much, but sadly it does not work for me.

 

         Let me put it simpler. Code goes like below:

 

         #include "erl_interface.h"

#include "ei.h"

         

typedef unsigned char byte;

         

int main()

{

    erl_init(NULL, 0);

    return 1;

}

 

         Using Cygwin or VS2010£¬compile command looks like below:

         gcc ei.c -o extprg -I/cygdrive/c/"Program Files"/erl6.2/usr/include
-L/cygdrive/c/"Program Files"/erl6.2/lib/erl_interface-3.7.18/lib
-lerl_interface ¨Clei

 

         error information is:

                   /tmp/ccrvLdwc.o:ei.c:(.text+0x1e): undefined reference to
`_erl_init'

 

         I find someone has the same problem at stackoverflow:
http://stackoverflow.com/questions/14185290/erl-interface-linker-error

         Someone gives a solution in that thread, but it does not work for
me too... ;(

 

·¢¼þÈË: Sergej Jurecko [mailto:sergej.jurecko@REDACTED] 
·¢ËÍʱ¼ä: 2014Äê11ÔÂ16ÈÕ 17:09
ÊÕ¼þÈË: ._
³­ËÍ: erlang-questions@REDACTED
Ö÷Ìâ: Re: [erlang-questions] Questions about how to link erl_interface.lib£¿

 

Best to use rebar. Add erts bin folder to system path, compile rebar on
windows (copy rebar and rebar.cmd files to your project), create
rebar.config and compile from visual studio console with rebar. 

 

 

Sergej

 

On 16 Nov 2014, at 03:35, ._ <yelt@REDACTED> wrote:





_______________________________________________
erlang-questions mailing list
 <mailto:erlang-questions@REDACTED> erlang-questions@REDACTED
 <http://erlang.org/mailman/listinfo/erlang-questions>
http://erlang.org/mailman/listinfo/erlang-questions

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20141117/85fd3d05/attachment.htm>


More information about the erlang-questions mailing list