![](/img/trans.png)
[英]Why can't my .NET CF application find a DLL In the same directory as the executable?
[英]DllImport can't find dll even though dll is in same folder as executable
我正在尝试使用llvm-fs项目,该项目为F#提供llvm绑定。 我已经使用--enable-shared
编译了LLVM-3.1.dll
文件,它现在与我编译的可执行文件位于同一目录中(我使用Environment.CurrentDirectory
检查)。 llvm-fs中的DllImport
看起来像:
[<DllImport(
"LLVM-3.1.dll",
EntryPoint="LLVMModuleCreateWithName",
CallingConvention=CallingConvention.Cdecl,
CharSet=CharSet.Ansi)>]
extern void* (* LLVMModuleRef *) moduleCreateWithNameNative(string ModuleID)
然而,当我运行我的应用程序时,它出错:
Unable to load DLL 'LLVM-3.1.dll': The specified module could not be found.
(Exception from HRESULT: 0x8007007E)
如何加载DLL? 作为参考, 这是我正在尝试加载的确切DLL 。
这个:
“指定的模块无法找到”
可以指向LLVM-3.1.dll
依赖的某个库,而不是LLVM-3.1.dll
本身。
当DLL或EXE无法加载时, Depends.exe非常方便 - 它显示完整的EXE / DLL依赖树,突出显示无法加载或丢失的内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.