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

[Windows] Visual C++ Redistributable is required at runtime #564

Closed
fakob opened this issue Jun 1, 2019 · 1 comment
Closed

[Windows] Visual C++ Redistributable is required at runtime #564

fakob opened this issue Jun 1, 2019 · 1 comment

Comments

@fakob
Copy link

fakob commented Jun 1, 2019

Hi

Does anyone know how to include Microsofts C++ Redistributable into opencv4nodejs/opencv-build?

My MoviePrint app packages opencv4nodejs with electron-builder into an electron desktop app. I now have noticed that the app only works on a computer where Microsofts C++ Redistributable is installed. If that is not the case, the following error is thrown:

Uncaught Error: The specified module could not be found.
\\?\C:\Users\Jakob\AppData\Local\Programs\movieprint-v004\resources\app\node_modules\opencv4nodejs\build\Release\opencv4nodejs.node
    at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:166:20)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:740)
    at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:166:20)
    at Module.load (internal/modules/cjs/loader.js:620)
    at tryModuleLoad (internal/modules/cjs/loader.js:559)
    at Function.Module._load (internal/modules/cjs/loader.js:551)
    at Module.require (internal/modules/cjs/loader.js:658)
    at require (internal/modules/cjs/helpers.js:20)
    at Object.<anonymous> (C:\Users\Jakob\AppDa…nodejs\lib\cv.js:17)
    at Object.<anonymous> (C:\Users\Jakob\AppDa…nodejs\lib\cv.js:28)

It seems that when the electron app is built, all dlls included in the Redistributable are added to the root folder of the app. I am unfortunately not familiar with how linking on Windows works. But I was wondering if opencv4nodejs/opencv-build could be built in a way that it recognises these dlls in the root folder and the user does not have to install the Redistributable in addition?

This issue mentions an article that it should be possible with some cmake flags.

Does anyone have experience with that?

@fakob
Copy link
Author

fakob commented Jun 3, 2019

It seems that I found a solution to my issue.

As mentioned packs electron some of the Redistributable dlls into the app, but misses the CONCRT140.dll.

Not sure why it is missing in the first place or what this dll is responsible for. However, after copying this file into the app's root folder, the aforementioned error is gone and the app runs as expected.

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

1 participant