![](/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.