ccmakecompiler-errorslmdb

Building LMDB master branch on Windows


I'm trying to build LMDB from master branch, because Windows incremental file growth patch is not merged into release branch.

I'm using CMake and MSVC compiler. And I'm trying to build lmdb as a static library.

Error I get is:

mdb.c(55,19): error C2143: syntax error: missing ')' before '__cdecl'

This is the line #55 from mdb.c, plus a few lines that follow it:

typedef NTSTATUS (WINAPI NtCreateSectionFunc)
  (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);

Any idea what is causing this and how to fix it?


Solution

  • It turns out that the problem was add_definitions(-DWIN32_LEAN_AND_MEAN) that was in another cmake of an external library.