I have 3 header files, x_tuple.h, node.h, rbtree.h. The three compile fine together but when I compile them with rbtree.cpp and main.cpp I get:
ld: duplicate symbol x_tuple::x_tuple()in /var/folders/we/weWPUgg0F3OSCT+uhlIc0k+++TI/-Tmp-//ccP5GVef.o and /var/folders/we/weWPUgg0F3OSCT+uhlIc0k+++TI/-Tmp-//ccPOMM2C.o
An #include directive is simply replaced with the contents of the specified file.
That means you now have two definitions of each x_tuple member function: one in main.cpp and one in rbtree.cpp.
Move the definitions inside the class declaration (which makes the compiler treat them as if they were declared inline, thus not subjecting them to the one definition rule) or move them into their own .cpp file.
To follow up Athar, #include absolutely does not include a library. A library is an already compiled object file (or nicely packaged set of them) which gets linked to at link time by the linker.
It is well worth taking ten minutes to read up on what a compiler does, what a linker does, and how the two work together. Really, really worth it.