Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-2826

Compiling with ENABLE_SRV=OFF broken on Windows

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.13.0, 1.14.0
    • Affects Version/s: None
    • Component/s: Build
    • None

      Was trying to setup a MongoDB Embedded builder for Windows and got the following compilation error when building for Windows:

      ClCompile:
        C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\CL.exe /c /I"C:\data\mongo-c-driver-1.12.0\src\libbson\src\bson" /I"C:\data\mongo-c-driver-1.12.0\src\libmongoc\src\mongoc" /I"C:\data\mongo-c-driver-1.12.0\src\libmongoc\..\..\src\common" /Zi /nologo /W3 /WX- /O2 /Ob1 /Oy- /D WIN32 /D _WINDOWS /D NDEBUG /D MONGOC_COMPILATION /D _CRT_SECURE_NO_WARNINGS /D _GNU_SOURCE /D _BSD_SOURCE /D _DEFAULT_SOURCE /D "CMAKE_INTDIR=\"RelWithDebInfo\"" /D mongoc_shared_EXPORTS /D _WINDLL /D _MBCS /Gm- /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"mongoc_shared.dir\RelWithDebInfo\\" /Fd"mongoc_shared.dir\RelWithDebInfo\vc140.pdb" /Gd /TC /analyze- /errorReport:queue "C:\data\mongo-c-driver-1.12.0\src\libmongoc\src\mongoc\mongoc-client.c"
        mongoc-client.c
      C:\data\mongo-c-driver-1.12.0\src\libmongoc\src\mongoc\mongoc-client.c(26): fatal error C1083: Cannot open include file: 'netdb.h': No such file or directory [C:\data\mongo-c-driver-1.12.0\src\libmongoc\mongoc_shared.vcxproj]
      Done Building Project "C:\data\mongo-c-driver-1.12.0\src\libmongoc\mongoc_shared.vcxproj" (default targets) -- FAILED.
      Done Building Project "C:\data\mongo-c-driver-1.12.0\src\libmongoc\mongoc-stat.vcxproj" (default targets) -- FAILED.
      Done Building Project "C:\data\mongo-c-driver-1.12.0\ALL_BUILD.vcxproj" (default targets) -- FAILED.
      

      We are passing the following flags to CMake:
      -DENABLE_SHM_COUNTERS=OFF
      -DENABLE_SNAPPY=OFF
      -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF
      -DENABLE_ZLIB=OFF
      -DENABLE_SSL=OFF
      -DENABLE_SASL=OFF
      -DENABLE_TESTS=OFF
      -DENABLE_SRV=OFF
      -DENABLE_EXAMPLES=OFF
      -DENABLE_STATIC=OFF

      By looking at the code, it seems like -DENABLE_SRV=OFF is the culprit. There's currently no test coverage for this on Evergreen (should probably be added).

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            henrik.edin@mongodb.com Henrik Edin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: