Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Linking Error: ... ***.so: undefined symbol: entropy_func - Please help with a problem #367

Open
Ob1To opened this issue Mar 17, 2017 · 2 comments

Comments

@Ob1To
Copy link

Ob1To commented Mar 17, 2017

I'm very new to node.js and all and was assign with a task. I have been using a lib so far like this:

function initLibrary() {
    MyLibrary = ffi.Library(path.join(__dirname, 'app/libs/libpcloudcc_lib'), {
        'psync_set_software_string': ['void', ['char *']],
        'get_token': ['string', []],
    });
}

but now I have been provided with a new lib for FB integration. They are 2 .so files and the one that I will use depends on another. I've searched so far and found that issue where you are explaining something similar - #80

My new .so files are pRJF.so, libcurl.so. Initially I've done something like this:

FbLib = ffi.Library(path.join(__dirname, 'app/libs/pRJF'), {
        'fb_authorize': ['char *', ['pointer']],
        'fb_login': ['int', ['char*', 'char **']]
    });

but I've received "App threw an error during load

Error: Dynamic Linking Error: /home/osboxes/Desktop/electron-app/app/libs/pRJF.so: undefined symbol: entropy_func

I guess these symbols are in the libcurl.so that I've done nothing so far with, just paste in the same lib folder with the others. I've tried to do something like that:

var RTLD_NOW = ffi.DynamicLibrary.FLAGS.RTLD_NOW;
    var RTLD_GLOBAL = ffi.DynamicLibrary.FLAGS.RTLD_GLOBAL;
    var mode = RTLD_NOW | RTLD_GLOBAL;
    var libCurl = ffi.DynamicLibrary(path.join(__dirname, 'app/libs/libcurl') + ffi.LIB_EXT, mode);

Again unsuccessfully, throwing the same error. The code though execute correct before the FbLib = ffi.Library(path.join(__dirname, 'app/libs/pRJF')...

Also I have tried to pass the libCurl as a 3rd parameter to the ffi.Library() function. once again with the same error:

FbLib = ffi.Library(path.join(__dirname, 'app/libs/pRJF'), {

        'fb_authorize': ['char *', ['pointer']],

        'fb_login': ['int', ['char*', 'char **']]
    }, libCurl);

Please help me because I'm on a verge of nervous breakdown, thank you!

@yft
Copy link

yft commented Apr 15, 2019

ffi.DynamicLibrary works for me. thank Ob1To

@yft
Copy link

yft commented Apr 15, 2019

Maybe you can try:

  • windows
    copy your dll to C:\Windows\System32
  • linux
vi /etc/ld.so.conf

add path where your .so in to this file

then

ldconfig

or

copy your .so to /usr/lib64

@Ob1To

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants