[CXX-119] dll attributes should not be applied to the static library build Created: 04/Mar/14 Updated: 09/Apr/14 Resolved: 05/Mar/14 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | legacy-0.0-26compat-2.6.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Andrew Morrow (Inactive) | Assignee: | Andrew Morrow (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | legacy-cxx | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
A mongo client header file, when included by a consumer, cannot know whether the link step will target a static or shared version of libmongoclient. As a result, it cannot independently determine whether to apply __declspec(dllimport) or not. An incorrect application results in a huge number of warnings. Since we don't expect the static library to work well in the first place, the best solution is to create a new #define macro that if present inhibits the application of any import or export macros. Clients intending to use the static library must define this symbol. When we observe the symbol in dbclient.h or bson.h, we inhibit MONGOCLIENT_CONSUMER. |
| Comments |
| Comment by Andrew Morrow (Inactive) [ 04/Mar/14 ] | ||||||||
| Comment by Andrew Morrow (Inactive) [ 04/Mar/14 ] | ||||||||
|
Basically, the block I want to add to dbclient.h and bson.h looks like this:
|