Search code examples
c++namespacesname-clash

namespace clash with two large libraries


I'm trying to use two very large C++ libraries to write my own library and application set and there are using directives present in the main header classes of both libraries. The conflict lies in a single class, called vector (with the std::vector). One header has "using namespace std", and this messes things up.

Is there a way to exclude the identifier from the namespace, after the "using namespace" has already been written?


Solution

  • Is there a way to get the worms back into the can?

    No.

    The best option is to fix the header with the using directive. Remove it and add the required std:: prefixes to the declarations.