[erlang-questions] 'C' Driver Question

Serge Aleynikov <>
Thu Sep 7 15:20:24 CEST 2006


What this means is that the driver name doesn't match filename.  Most 
likely you gave an inconsistent name to your driver in the ErlDrvEntry 
structure, it should be:

ErlDrvEntry sample_driver_entry = {
     ...
     "liber_driver",   /* char *driver_name, the argument to open_port */
     ...
};

Also you can make the error reason more verbose by using 
erl_ddll:format_error/1:

case erl_ddll:load_driver(".", liber_driver) of
ok ->
    ...;
{error, Reason} ->
    {error, erl_ddll:format_error(Reason)}
end.

Regards,

Serge

Bob Cowdery wrote:
> Hi
> 
> I've just started to use Erlang and this is my first post. I have a requirement to communicate between two parts of a 'C' program. One part will be a C Port and the other a C Driver type implementation. The C Port side is working but I'm having trouble with the C Driver. I have been following the examples in the Interoperability Tutorial, so first off I just wantsed to roughly follow the examples. I have built the shared library but I can't load it. This is under Ubuntu Linux incidentally. I have a library called liber_driver.so and I try to load it with 
> 
> erl_ddll:load_driver(".", liber_driver).
> 
> I know it's loading the file because it first gave me some unresolved errors. When I fixed those it now says
> 
> {error,bad_driver_name}
> 
> I have no idea what this means, any help appreciated.
> 
> Regards
> Bob
> 




More information about the erlang-questions mailing list