Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-96

Enforce /MD with Windows C++ DLL driver

    XMLWordPrintable

    Details

      Description

      In order to prevent build mistakes, the C++ driver should ensure that _MD is defined, since we are compiling the shared library with /MD. This ensures that the same C RTL (and thus the same heap) is used across all translation units between the mongo library and the client code:

      #if( !defined(_MD) )
      #error _MD is not defined
      #endif

      We're already doing this in version.cpp, but of course this code isn't hit by consumers of the C++ driver. It needs to be in a header.

      Also, confusingly, we are using /MDd for debug mode; I think this ought to be /MTd, since we're not building a DLL. This could cause weirdness if driver developers didn't also use /MDd.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              milkie Eric Milkie
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: