When you create a template, you should either put definition in the header or use export keyword in cpp. Unfortunately, many(almost all) compilers just ignore export in such context, so the only option you have is to put definition into your header file.