Why do I have to rebuild my project after creating a new C++ class

Every time I create a new C++ class, my build times take ridiculously long. Before creating a new class, my build time takes 5 seconds. After creating a new c++ class my build times bump up to 200 - 500 seconds. This results in me having to rebuild the project in order to get my normal build time back. I have had this issue for both Rider and Visual Studio. I have looked everywhere for a solution with no success. Please help