[erlang-questions] : {error, no_driver_init}

Raimo Niskanen raimo+erlang-questions@REDACTED
Tue Oct 10 09:07:00 CEST 2006


On Mon, Oct 09, 2006 at 03:57:14PM +0100, Bob Cowdery wrote:
> 
> 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.

Well, the Erlang VM is built using an ancient VC6, that is true.
If that makes the library incompatible is more than I know...

> > >
> > > 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
> 
> ------------------
> Nicolas
> 
> Thanks for the hint. I did get it working but had to compile it as C++ and then extern "C" the exported method. I checked and it was exported fine when compiled as C but Erlang just couldn't see it. I don't like things I can't explain so if anyone knows why this is I would be pleased to hear.
> 
> Thanks
> Bob
> 
> 
> [1] DependencyWalker : http://www.dependencywalker.com/
> 
> 
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB




More information about the erlang-questions mailing list