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

msvcp140.dll is missing on Windows #48

Closed
FabienDehopre opened this issue Oct 12, 2017 · 11 comments
Closed

msvcp140.dll is missing on Windows #48

FabienDehopre opened this issue Oct 12, 2017 · 11 comments

Comments

@FabienDehopre
Copy link

I installed the clang-format package in my project and when I try to execute clang-format using a npm script, I receive the following error message:

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "format"
npm ERR! node v6.11.3
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! Partenaire@1.0.0-alpha.0 format: `clang-format -i -verbose src/**/*.ts`
npm ERR! Exit status 3221225781
npm ERR!
npm ERR! Failed at the Partenaire@1.0.0-alpha.0 format script 'clang-format -i -verbose src/**/*.ts'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the Partenaire package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     clang-format -i -verbose src/**/*.ts
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs Partenaire
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls Partenaire
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\dvlp\partenairefrontendrepo\npm-debug.log

Here is the content of the npm-debug.log:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'format' ]
2 info using npm@3.10.10
3 info using node@v6.11.3
4 verbose run-script [ 'preformat', 'format', 'postformat' ]
5 info lifecycle Partenaire@1.0.0-alpha.0~preformat: Partenaire@1.0.0-alpha.0
6 silly lifecycle Partenaire@1.0.0-alpha.0~preformat: no script for preformat, continuing
7 info lifecycle Partenaire@1.0.0-alpha.0~format: Partenaire@1.0.0-alpha.0
8 verbose lifecycle Partenaire@1.0.0-alpha.0~format: unsafe-perm in lifecycle true
9 verbose lifecycle Partenaire@1.0.0-alpha.0~format: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;D:\dvlp\partenairefrontendrepo\node_modules\.bin;C:\Program Files\ConEmu\ConEmu\Scripts;C:\Program Files\ConEmu;C:\Program Files\ConEmu\ConEmu;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\oracle\product\10.2.0\client_1\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x64;C:\Program Files (x86)\Sybase\Shared\PowerBuilder\;C:\Program Files (x86)\SQL Anywhere 11\bin64;C:\Program Files (x86)\SQL Anywhere 11\bin32;C:\Program Files (x86)\Sybase\Shared\PowerBuilder;C:\Program Files (x86)\Sybase\PowerBuilder 11.5;C:\Windows\Microsoft.NET\Framework\v2.0.50727;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Oracle\Ora81\Bin;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Program Files (x86)\WinMerge;L:\OPW-BIN\BIN;C:\Users\al4971\AppData\Roaming\npm;C:\Program Files\Microsoft VS Code\bin;C:\Users\al4971\AppData\Roaming\npm
10 verbose lifecycle Partenaire@1.0.0-alpha.0~format: CWD: D:\dvlp\partenairefrontendrepo
11 silly lifecycle Partenaire@1.0.0-alpha.0~format: Args: [ '/d /s /c', 'clang-format -i -verbose src/**/*.ts' ]
12 silly lifecycle Partenaire@1.0.0-alpha.0~format: Returned: code: 3221225781  signal: null
13 info lifecycle Partenaire@1.0.0-alpha.0~format: Failed to exec format script
14 verbose stack Error: Partenaire@1.0.0-alpha.0 format: `clang-format -i -verbose src/**/*.ts`
14 verbose stack Exit status 3221225781
14 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:920:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
15 verbose pkgid Partenaire@1.0.0-alpha.0
16 verbose cwd D:\dvlp\partenairefrontendrepo
17 error Windows_NT 6.1.7601
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "format"
19 error node v6.11.3
20 error npm  v3.10.10
21 error code ELIFECYCLE
22 error Partenaire@1.0.0-alpha.0 format: `clang-format -i -verbose src/**/*.ts`
22 error Exit status 3221225781
23 error Failed at the Partenaire@1.0.0-alpha.0 format script 'clang-format -i -verbose src/**/*.ts'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the Partenaire package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     clang-format -i -verbose src/**/*.ts
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs Partenaire
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls Partenaire
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

If I try to execute the clang-format.exe program directly, a popup appears indicating that a DLL is missing: msvcp140.dll. It seems that this DLL is part of the VS2015 C++ Redist package.
I'm currently working on a computer where I cannot install the VS2015 C++ Redist package.
Maybe it might be a good idea to bundle the clang-format.exe with its dependencies (DLL).

@FabienDehopre FabienDehopre changed the title msvcp140.dll is missing msvcp140.dll is missing on Windows Oct 12, 2017
@FabienDehopre
Copy link
Author

For info, there are two DLL that are missing and that can be added in the win32 bin folder:

  • msvcp140.dll
  • vcruntime140.dll
    I can create a pull request to add both DLL beside the clang-format.exe program file.

@mprobst
Copy link
Contributor

mprobst commented Oct 12, 2017 via email

@FabienDehopre
Copy link
Author

FabienDehopre commented Oct 12, 2017

BTW, I also tried to install the VS2015 C++ Redist package on another computer and clang-format.exe fails with the same issue. It seems that the program cannot find the required DLL even when they are installed in c:\windows\system32 folder.
It only works when both DLL are beside the clang-format.exe program file. :'(
@mprobst Indeed, if you can create a self contained binary it would be far easier.

mprobst added a commit that referenced this issue Oct 16, 2017
This includes a win32 binary compiled with the /MT switch, which
fixes issue #48.
@mprobst
Copy link
Contributor

mprobst commented Oct 16, 2017

@FabienDehopre could you try out the win32 binary I've added in #50, and see if that resolves the issue? I built that using /MT, which I think should fix the problem, but I have no good way of testing.

@FabienDehopre
Copy link
Author

I've tried the binary you've added in #50 but it still not working.
Now I have a message for another missing DLL: msvcp140d.dll (notice the final "d").

@mprobst
Copy link
Contributor

mprobst commented Oct 16, 2017

@FabienDehopre sorry for the back and forth. Can you try once more? I've updated clang-format.exe to use slightly different compiler flags.

@FabienDehopre
Copy link
Author

FabienDehopre commented Oct 17, 2017

Unfortunately, it still does not work. We are back to the missing msvcp140.dll. :(

@mprobst
Copy link
Contributor

mprobst commented Oct 17, 2017 via email

@FabienDehopre
Copy link
Author

Good news! This version works correctly on my machine :-)

@mprobst
Copy link
Contributor

mprobst commented Oct 18, 2017

Woohoo. Well that was a trip down memory lane into DLL hell :-)

mprobst added a commit that referenced this issue Oct 18, 2017
This includes a win32 binary compiled with the /MT switch by passing -DLLVM_USE_CRT_RELEASE=MT to configure clang format. Linking in the runtime libraries and producing a static binary fixes issue #48.
@mprobst mprobst closed this as completed Oct 18, 2017
@mprobst
Copy link
Contributor

mprobst commented Oct 18, 2017

Published as clang-format 1.1.0.

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