Namespace collision
pawelswoboda opened this issue · 2 comments
When using meta and curses together, a name collision occurs, as there is a function called meta in curses, see http://linux.die.net/man/3/meta
I don't know of any good standard way of solving this problem. The two following workarounds "work" but are ugly:
namespace linux {
#include <ncurses.h>
} // namespace linux
using linux::max_align_t; // ncurses assumes it is in the global namespace
#include <meta/meta.hpp>
will probably fail to link, but since meta is header only the following might work fine as long as meta
doesn't internally assume that its namespace is in the global namespace (which might assume as an implementation detail sooner or later):
#include <ncurses.h>
namespace cpp {
#include <meta/meta.hpp>
} // namespace cpp
So... you can give any of these a try and see if it solves your problem, but these solution even if they seem to work are going to be very fragile. Is there a standard way of dealing with this issue?
So I've asked this on SO: http://stackoverflow.com/questions/37393414/name-collision-between-c-library-namespace-and-c-linux-function
Seems that your best bet is to use the ncurses
c++ bindings. If they are not shipped by your distribution they should be inside the ncurses
source directory.