「 MSVCP100.dllが見つから・・・」というエラーが出たときの対処方法
問題
Visual C++でプログラムをReleaseモードでビルドしたけど、
「MSVCP100.dll が見つからなかったため、このアプリケーションを開始できませんでした。」
というエラーが出たときの対処方法。
事の発端は
ニコニコ生放送用のコメントビュアー For Google Chromeのバグ報告で上記のエラーが出ることを知った。
解決策1
バグを報告していただいたユーザから解決方法も教えていただいた。
「ランタイムライブラリ」の設定を「マルチスレッドDLL(/MD)」に変更すれば良いとの事だったので、
アドバイス通り使用としたが、すでになっていた。
依存しているDLLを列挙するコマンド(Visual Studioコマンドプロンプトを起動するべし)
dumpbin /dependents Hoge.dll
依存関係の調査
C:\ ... \Release>dumpbin /dependents NiconamaClientPlugin.dll Microsoft (R) COFF/PE Dumper Version 10.00.30319.01 Copyright (C) Microsoft Corporation. All rights reserved. Dump of file NiconamaClientPlugin.dll File Type: DLL Image has the following dependencies: KERNEL32.dll MSVCP100.dll MSVCR100.dll WS2_32.dll Summary 3000 .data A000 .rdata 5000 .reloc 1000 .rsrc 1A000 .text 1000 .tls
問題の「MSVCP100.dll」に依存していることが分かる。
そこでググルとこの下記の記事がヒットした。
参考にした記事
forex tester2のインディケーターを自作 : MSVCP100.dll、MSVCR100.dll を必要としないビルド方法
「ランタイムライブラリ」の設定で「マルチスレッド (/MT)」にす呼ばよいとの事。
再度、依存関係の調査
C:\ ... \Release>dumpbin /dependents NiconamaClientPlugin.dll Microsoft (R) COFF/PE Dumper Version 10.00.30319.01 Copyright (C) Microsoft Corporation. All rights reserved. Dump of file NiconamaClientPlugin.dll File Type: DLL Image has the following dependencies: KERNEL32.dll WS2_32.dll Summary 7000 .data D000 .rdata 6000 .reloc 1000 .rsrc 30000 .text 1000 .tls
MSVCP100.dllと共にMSVCR100.dllも依存を解消できた。