LoadLibrary加载dll失败, 报告"找不到指定的模块" 的问题的解决

老杨封装了一个视频处理的C++编写的DLL. C#程序里LoadLibrary加载dll失败, 报告"找不到指定的模块" . 

一些文章说是DLL的unicode设置的问题. 设置Visual Studio的unicode环境设置: C/C++, Preprocessor difinitions 去除_MBCS,加_UNICODE,UNICODE   无效

用Dependency Walker查看我编写的封装dll的依赖项, 除了avcodec.dll, avutil.dll等几个之外, Dependency Walker还报告以下依赖的dll找不到:

API-MS-WIN-CORE-COM-L1-1-0.DLL 

API-MS-WIN-CORE-WINRT-ERROR-L1-1-0.DLL 

API-MS-WIN-CORE-WINRT-L1-1-0.DLL 

API-MS-WIN-CORE-WINRT-ROBUFFER-L1-1-0.DLL 

API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL 

API-MS-WIN-SHCORE-SCALING-L1-1-0.DLL 

DCOMP.DLL 

GPSVC.DLL 

IESHIMS.DLL 

 

后来查找到http://stackoverflow.com/questions/1043913/copying-a-dlls-dependencies-in-visual-studio

里面提到Dependency Walker is misleading in this case and caused me to lose time. the list of "missing" dlls from first post is not helpful, you can probably ignore it. 

即Dependency Walker的报告其实是误导了, 上面的那些依赖DLL其实都用不着, 还是只要有avcodec.dll, avutil.dll那几个就可以了, 把这几个dll移至exe可执行文件的同一目录下,问题解决!

 

你可能感兴趣的:(LoadLibrary加载dll失败, 报告"找不到指定的模块" 的问题的解决)