I am starting some work using a third-party library, and when I created it in Visual Studio 2010, I noticed that I received this linker warning ( LNK4221 ) more than once . I looked at the sources used to create the object files that were linked, and found that the entire implementation for them is in the header files. Interestingly, I also noticed that the project included the corresponding .cpp files containing only #include for the header with the implementation.
I am curious - what is the meaning of this and why I want to use this technique? If the .cpp files do not add any value to the project, why don't I just delete them to get rid of the linker warnings?
I tried to find similar questions, but did not find anything interesting. If you know about them, please connect them.
Joe bane
source share