-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Internal Code
-
None
-
ALL
service_context_d is a library with some undefined references:
build/ninja/mongo/db/s/libsharding.so: error: undefined reference to 'mongo::ShardServerCatalogCacheLoader::ShardServerCatalogCacheLoader(std::unique_ptr<mongo::CatalogCacheLoader, std::default_delete<mongo::CatalogCacheLoader> >)' build/ninja/mongo/db/s/libsharding.so: error: undefined reference to 'vtable for mongo::ReadOnlyCatalogCacheLoader' /opt/mongodbtoolchain/v2/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function build/ninja/mongo/db/s/libsharding.so: error: undefined reference to 'mongo::ChunkSplitter::setReplicaSetMode(bool)' build/ninja/mongo/db/s/libsharding.so: error: undefined reference to 'mongo::ChunkSplitter::get(mongo::OperationContext*)' clang-3.9: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed.
(I produced this by simply making service_context_d a Program instead of a Library, and adding a trivial main() module to it.)
This means that if you attempt to add service_context_d to a LIBDEPS section, without also adding the libraries containing the missing symbols to the same section, you will get link errors such as the above.
Would it be possible to, in general, enforce that our libraries can all stand by themselves with no undefined references? We could make a whitelist of libraries that cannot abide by this rule, if necessary.
- duplicates
-
SERVER-29908 Libraries db/s/sharding and db/query/query are directly cyclic
- Closed