Modules are obviously the best solution for this purpose, but not the only one. Even in C, which has neither modules nor namespaces, you can avoid prefix collisions with a little bit of macro usage by making the prefix configurable in such a way that the consumer of the library only has to define a preprocessor constant before including the library if they're unlucky enough to have stumbled upon two different libraries with the same prefix, with no action required otherwise. Even for the author of an library this approach doesn't require any unreasonable levels of macro usage. In practice this approach is rare, but I've seen a couple of libraries use it, so it's not completely theoretical.