<p>Hi Jeffrey,</p>
<p>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.</p>
<p>Regards,<br>
Robby<br>
</p>
<div class="gmail_quote">On Jan 3, 2013 3:26 AM, "Jeffrey Rennie" <<a href="mailto:surferjeff@gmail.com">surferjeff@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm working through the example here:<br>
<a href="http://www.erlang.org/doc/tutorial/c_portdriver.html" target="_blank">http://www.erlang.org/doc/tutorial/c_portdriver.html</a><br>
And I'm trying to get it to run on Windows. I reordered the code in the C<br>
source so that it compiles, and added a module.def file so that erlang<br>
actually finds and executes the driver init function.<br>
<br>
I attached a debugger. Walking back up the stack, I observe that:<br>
The driver init function returns correctly.<br>
erts_sys_ddll_call_init() returns correctly.<br>
do_load_driver_entry() returns ERL_DE_NO_ERROR.<br>
load_driver_entry() returns ERL_DE_NO_ERROR.<br>
erl_ddll_try_load_3 returns t = TUPLE2(hp, am_ok, ok_term); on line 417 of<br>
erl_bif_ddl.c.<br>
But the next higher call on the stack is _process_main(), which was compiled<br>
with gcc and has no debug symbols so I can't step through and figure out why<br>
the end result is:<br>
<br>
=ERROR REPORT==== 2-Jan-2013::19:14:22 ===<br>
Error in process <0.31.0> with exit value:<br>
{enoent,[{erlang,open_port,[{spawn,"example_drv"},[]],[]},{complex5,init,1,[<br>
{file,"c:/Users/jeff/code/code/port_driver/complex5.erl"},{line,19}]}]}<br>
<br>
Has anyone seen this before?<br>
<br>
If not, how do I recompile erl.exe purely with cl.exe (no gcc) so that it<br>
generates debug symbols? And while I'm recompiling, how do I turn off all<br>
optimizations? I can read basic make files, but I get lost in the configure<br>
scripts and .in and .mk files. Please take pity on a Windows programmer ;-)<br>
<br>
<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div>