[erlang-questions] nif problem in windows

Dave Cottlehuber dch@REDACTED
Tue May 7 13:37:14 CEST 2013


On 7 May 2013 12:00, 韦崇焜 <wckbluesky@REDACTED> wrote:

> hi
>
> I am testing nif in windows right now, the nif c code is very simple and
> it is copyed directly from
> http://www.erlang.org/doc/tutorial/nif.html#id64988
>
> All the code is running well in Linux, and c code is compiled to .so in
> linux, .dll in windows
>
> Everything is ok before I running "c(complex6)" in erlang VM, in windows,
>
> it reports
>
> =ERROR REPORT==== 7-May-2013::17:36:19 ===
> Error in process <0.70.0> with exit value:
> {{badmatch,{error,{load_failed,"Faile
> d to load NIF library ./complex6_nif: 'Unspecified
> error'"}}},[{complex6,init,0,
>
> [{file,"complex6.erl"},{line,7}]},{code_server,'-handle_on_load/4-fun-0-',1,[{fi
> le,"code_server.erl"},...
>
>
> =ERROR REPORT==== 7-May-2013::17:36:19 ===
> The on_load function for module complex6 returned {{badmatch,
>                                                     {error,
>                                                      {load_failed,
>                                                       "Failed to load NIF
> library ./complex6_nif: 'Unspecified error'"}}},
>                                                    [{complex6,init,0,
>                                                      [{file,...},{...}]},
>                                                     {code_server,
>
>  '-handle_on_load/4-fun-0-',
>                                                      1,
>                                                      [{...}|...]}]}
> {error,on_load_failure}
>
> It is hard to find some useful information in google.
> Can anyone tell how to fix it?
>
>
Hi ckwei,

It might be useful to paste some of the source code that isn't working for
you. I don't have windows handy, but here's a NIF example that works on
both Windows using command shell and SDK 7.1,  and LInux, that Volker & I
did last year. The erlang side NIF loader was poached from one of Paul
Davis' projects IIRC.

https://github.com/vmx/hellonif

A+
Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130507/0fdea7f4/attachment.htm>


More information about the erlang-questions mailing list