[erlang-questions] {error, no_driver_init}

Nicolas Charpentier ncharpentier@REDACTED
Fri Oct 6 20:39:17 CEST 2006


Bob Cowdery a écrit :
> > Hi
> >
> > I am trying to get a port driver to work on Windows. This is just
the example in the tutorial . I can get it going on Linux but I get the
no_driver_init error on Windows. I have built this with Visual Studio
Express, so it's VC8. I am wondering if Erlang is built with VC6 and
therefore the library is incompatible. Could this be the case? Other
than that maybe its incorrect flag settings. I have set it to build C
but don't know what else might be important.
> >
> > Any help appreciated.
> >
> > Thanks
> > Bob


Hi,
There is long time I didn't play with drivers but I remember this kind
of trouble.
Check that your driver is exporting the driver_init() function. (You can
easily check this with DependencyWalker [1] ).
I also remember that the sample didn't work with me I had to do as follow:

ErlDrvEntry messenger_driver_entry = {
    NULL,  /* F_PTR init, N/A */
    messenger_driver_start,
    messenger_driver_stop,
    messenger_driver_output,
    NULL,
    NULL,
    "messenger_driver",
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL
};

extern "C"
{
  DRIVER_INIT (messenger_driver)
  {
    return &messenger_driver_entry;
  }
}

Regards,
Nicolas



[1] DependencyWalker : http://www.dependencywalker.com/





More information about the erlang-questions mailing list