undefined reference and multiple definitions errors are resolved