[SERVER-9771] Enable support for building the C++ driver as a DLL on windows. Created: 23/May/13  Updated: 10/Mar/14  Resolved: 13/Sep/13

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 2.5.3

Type: Improvement Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Eric Milkie
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by DOCS-1932 Document: Enable support for building... Closed
Related
is related to CXX-81 On Windows, MONGO_API functions shoul... Closed
is related to SERVER-6514 scons --sharedclient mongoclient buil... Closed
Backwards Compatibility: Fully Compatible
Participants:

 Description   

Attempting to build a DLL for the C++ driver fails on windows, but many of our clients would do better to use it than the static library.



 Comments   
Comment by auto [ 12/Sep/13 ]

Author:

{u'username': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: SERVER-9771 build Windows dynamic library C++ driver

Add generate_def.py script for windows dll.
Expose all public symbols found in the static library.
Note that the static Windows library may not work properly, as
not all obj modules may be included by the linker, despite their
necessity for their global initializers. This dynamic library
will include all necessary obj modules.
Branch: master
https://github.com/mongodb/mongo/commit/9ab28c9b500d1fea9367d8eaee337b70b66ca11f

Comment by auto [ 12/Sep/13 ]

Author:

{u'username': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: SERVER-9771 allow libdeps to process emitter intermediate output with targets that may be strings
Branch: master
https://github.com/mongodb/mongo/commit/8214ffd81ccc4d6f485f9c0b9c1417136706054a

Comment by Andrew Morrow (Inactive) [ 12/Jun/13 ]

Not making this 'depend' since we probably want to close SERVER-6514 when we have a shared library, but it is related, and we do want to do this.

Comment by Andrew Morrow (Inactive) [ 23/May/13 ]

Agreed, but that is identical to the (poor) semantics of the shared client on UNIX, so we are no worse. Later, we will have a project to actually produce a defined client API and use visibility/dllexport attributes to restrict to that. But the alternative is to not offer DLL on windows.

Comment by Tad Marshall [ 23/May/13 ]

I think that following the StackOverflow method will make the entire internal API the external API, which would not be desirable.

Comment by Andrew Morrow (Inactive) [ 23/May/13 ]

Due to SERVER-5650, we can't just build as a straight DLL. However, Andy found a potential workaround: http://stackoverflow.com/questions/225432/export-all-symbols-when-creating-a-dll. If that works, we can sidestep SERVER-5650, at least for a while.

Generated at Thu Feb 08 03:21:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.