Hello all,
I am unable to load libconfd.so shared library in my erlang VM. When I run the function erlang:load_nif("./libconfd", 0), I get the following error
{error,{load_failed,“Failed to load NIF library: ‘./libconfd.so: undefined symbol: DES_ede3_cbc_encrypt’”}}. Why am i getting this error?
What makes you think that you should load libconfd.so into your erlang VM at all, and in particular by running that function?
The reason for the specific error is not important - just don’t attempt the loading, it serves no useful purpose.
As a managed object communicates with the confd server(running on a different host) over socket IPC, i thought there might be some specific configuration parameters included in the libconfd library besides native IPC configuration. So, i thought i might have to load and use this library in my erlang application in order to establish connection with the confd server. Is it so?
I am sorry if I am wrong. I am very new to confd and trying to get hang of it.
and about that function erlang:load_nif/2, it is used to load native implemented function library which later appear as any other erlang functions to the callers.
No, as I wrote, it serves no useful purpose to try to load libconfd.so into your Erlang VM. The libconfd library is essentially the same thing as the econfd
application, just C instead of Erlang - i.e. it turns function calls into messages on an IPC socket and vice versa.
That’s fine, but it will be easier if you ask about the problem(s) you actually have, instead of taking a wild guess at a solution and then asking about problems with that “solution”. (But I see that you are doing the former in the other thread you started.)
That is absolutely true, but there are no NIFs defined or used for the ConfD ↔ application IPC communication, and libconfd has just the “normal” C functions documented in the man pages (plus internal utility functions).
Taking a step back, I think I can see your reasoning - I guess that you thought that this loading would make the C functions in libconfd, e.g.
int cdb_connect(int sock,
enum cdb_sock_type type,
const struct sockaddr* srv, int srv_sz);
available for calling directly from Erlang. Unfortunately there’s a lot more involved in writing Erlang NIFs - but the good thing is that you don’t need to care about that, all the functions you need are already available as normal Erlang functions in the econfd
application. E.g. the econfd_cdb:connect/2 function corresponds to the cdb_connect() function in the C API.
Oh very well then, I get it. Thank you.
Yeah I totally understand that, I would definitely do it from here on. And sure i did.
Oh I see. Very well then. Thank you.
Yes, this is exactly what i thought. I totally get it now. Thank you.