[c++] Error with multiple definitions of function