Link 项目 ntdll.dll 在 Visual Studio
Link project with ntdll.dll in Visual Studio
我尝试使用 Visual Studio 构建 lmdb,但出现以下错误:
mdb.obj : error LNK2001: unresolved external symbol _NtMapViewOfSection@40
mdb.obj : error LNK2001: unresolved external symbol _NtClose@4
mdb.obj : error LNK2001: unresolved external symbol _NtCreateSection@28
对于此函数在代码中的首次使用,有以下评论:
/* We use native NT APIs to setup the memory map, so that we can
* let the DB file grow incrementally instead of always preallocating
* the full size. These APIs are defined in <wdm.h> and <ntifs.h>
* but those headers are meant for driver-level development and
* conflict with the regular user-level headers, so we explicitly
* declare them here. Using these APIs also means we must link to
* ntdll.dll, which is not linked by default in user code.
*/
NTSTATUS WINAPI
NtCreateSection(OUT PHANDLE sh, IN ACCESS_MASK acc,
IN void * oa OPTIONAL,
IN PLARGE_INTEGER ms OPTIONAL,
IN ULONG pp, IN ULONG aa, IN HANDLE fh OPTIONAL);
我如何在 Visual Studio 中 link ntdll.dll?我明白了,这个问题很愚蠢,但我无法在几个小时内找到解决方案..
您可以 link 在 Visual Studio 中使用 ntdll.lib
。
非常感谢@datjko!他是对的:
I believe the version number in trunk was not updated by mistake.
Version 0.9.17 was released in Nov 30, 2015 and is available here
github.com/LMDB/lmdb/releases/tag/LMDB_0.9.17. As far as I can see,
using of functions from ntdll was added to trunk after the release in
github.com/LMDB/lmdb/commit/… also in Nov 30, 2015. So, unless you
want to testdrive the recent development version I believe you'd
better use a recent stable version.
按照他的建议问题解决了。
我尝试使用 Visual Studio 构建 lmdb,但出现以下错误:
mdb.obj : error LNK2001: unresolved external symbol _NtMapViewOfSection@40
mdb.obj : error LNK2001: unresolved external symbol _NtClose@4
mdb.obj : error LNK2001: unresolved external symbol _NtCreateSection@28
对于此函数在代码中的首次使用,有以下评论:
/* We use native NT APIs to setup the memory map, so that we can
* let the DB file grow incrementally instead of always preallocating
* the full size. These APIs are defined in <wdm.h> and <ntifs.h>
* but those headers are meant for driver-level development and
* conflict with the regular user-level headers, so we explicitly
* declare them here. Using these APIs also means we must link to
* ntdll.dll, which is not linked by default in user code.
*/
NTSTATUS WINAPI
NtCreateSection(OUT PHANDLE sh, IN ACCESS_MASK acc,
IN void * oa OPTIONAL,
IN PLARGE_INTEGER ms OPTIONAL,
IN ULONG pp, IN ULONG aa, IN HANDLE fh OPTIONAL);
我如何在 Visual Studio 中 link ntdll.dll?我明白了,这个问题很愚蠢,但我无法在几个小时内找到解决方案..
您可以 link 在 Visual Studio 中使用 ntdll.lib
。
非常感谢@datjko!他是对的:
I believe the version number in trunk was not updated by mistake. Version 0.9.17 was released in Nov 30, 2015 and is available here github.com/LMDB/lmdb/releases/tag/LMDB_0.9.17. As far as I can see, using of functions from ntdll was added to trunk after the release in github.com/LMDB/lmdb/commit/… also in Nov 30, 2015. So, unless you want to testdrive the recent development version I believe you'd better use a recent stable version.
按照他的建议问题解决了。