diff --git a/core/metacling/src/TCling.cxx b/core/metacling/src/TCling.cxx index d6b35d42f0879..ad421ec3ef8ec 100644 --- a/core/metacling/src/TCling.cxx +++ b/core/metacling/src/TCling.cxx @@ -1986,7 +1986,11 @@ void TCling::RegisterModule(const char* modulename, bool ModuleWasSuccessfullyLoaded = false; if (hasCxxModule) { - std::string ModuleName = llvm::StringRef(modulename).substr(3).str(); + std::string ModuleName = modulename; + // Remove lib from modulename if any + if (llvm::StringRef(modulename).startswith("lib")) + ModuleName = modulename + 3; + // FIXME: We should only complain for modules which we know to exist. For example, we should not complain about // modules such as GenVector32 because it needs to fall back to GenVector. ModuleWasSuccessfullyLoaded = LoadModule(ModuleName, *fInterpreter, /*Complain=*/ false);