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

Can't run due to "Dynamic Linking Error" #25

Closed
CryptoSharon opened this issue Oct 9, 2018 · 3 comments
Closed

Can't run due to "Dynamic Linking Error" #25

CryptoSharon opened this issue Oct 9, 2018 · 3 comments

Comments

@CryptoSharon
Copy link

CryptoSharon commented Oct 9, 2018

I just installed the library and I haven't been able to run it. This might be an installation problem. I followed the instructions to the letter.

My code is:

const { Client } = require('tdl')

const client = new Client({
  apiId: my.id, // Your api_id
  apiHash: my.hash// Your api_hash
})

This is the error I get:

C:\Users\pc\projects\denbot\node_modules\ffi-napi\lib\dynamic_library.js:74
    throw new Error('Dynamic Linking Error: ' + err);
    ^

Error: Dynamic Linking Error: Win32 error 126
    at new DynamicLibrary (C:\Users\pc\projects\denbot\node_modules\ffi-napi\lib\dynamic_library.js:74:11)
    at Object.Library (C:\Users\pc\projects\denbot\node_modules\ffi-napi\lib\library.js:45:14)
    at new TDLib (C:\Users\pc\projects\denbot\node_modules\tdl\dist\tdlib-ffi.js:42:37)
    at new Client (C:\Users\pc\projects\denbot\node_modules\tdl\dist\client.js:180:50)
    at Object.<anonymous> (C:\Users\pc\projects\denbot\index.js:3:16)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
@Bannerets
Copy link
Owner

Something is wrong with linking. Try using Dependency Walker or something like this.
See also node-ffi/node-ffi#294.

By default tdl searches for tdjson.dll in the current working directory.

@Bannerets
Copy link
Owner

Bannerets commented Oct 10, 2018

For me on Windows it works perfectly with binaries from https://github.com/ForNeVeR/tdlib.native/releases/tag/v1.3.0 and with this project structure:

.
├── index.js
├── tdjson.dll
└── zlib1.dll

@CryptoSharon
Copy link
Author

Ahaa, this solved it! Sorry for my cluelessness.

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