[erlang-questions] open_port returns enoent even when driver init function executes correctly.

Robert Raschke <>
Thu Jan 3 09:30:48 CET 2013


Hi Jeffrey,

I don't have those sources in front of me, but is there any chance that the
C code depends on another DLL? And that other one isn't on the path when
the driver is started from Erlang? I've found Windows to be super obscure
when dependencies in DLLs don't resolve properly.

Regards,
Robby
 On Jan 3, 2013 3:26 AM, "Jeffrey Rennie" <> wrote:

> I'm working through the example here:
> http://www.erlang.org/doc/tutorial/c_portdriver.html
> And I'm trying to get it to run on Windows.  I reordered the code in the C
> source so that it compiles, and added a module.def file so that erlang
> actually finds and executes the driver init function.
>
> I attached a debugger.  Walking back up the stack, I observe that:
> The driver init function returns correctly.
> erts_sys_ddll_call_init() returns correctly.
> do_load_driver_entry() returns ERL_DE_NO_ERROR.
> load_driver_entry() returns ERL_DE_NO_ERROR.
> erl_ddll_try_load_3 returns t = TUPLE2(hp, am_ok, ok_term); on line 417 of
> erl_bif_ddl.c.
> But the next higher call on the stack is _process_main(), which was
> compiled
> with gcc and has no debug symbols so I can't step through and figure out
> why
> the end result is:
>
> =ERROR REPORT==== 2-Jan-2013::19:14:22 ===
> Error in process <0.31.0> with exit value:
>
> {enoent,[{erlang,open_port,[{spawn,"example_drv"},[]],[]},{complex5,init,1,[
> {file,"c:/Users/jeff/code/code/port_driver/complex5.erl"},{line,19}]}]}
>
> Has anyone seen this before?
>
> If not, how do I recompile erl.exe purely with cl.exe (no gcc) so that it
> generates debug symbols?  And while I'm recompiling, how do I turn off all
> optimizations?  I can read basic make files, but I get lost in the
> configure
> scripts and .in and .mk files.  Please take pity on a Windows programmer
> ;-)
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130103/6ef60111/attachment.html>


More information about the erlang-questions mailing list