I am working on a project using c++/windows forms (visual studio 2010), we have 4 projects:
Disclaimer: This solution is indeed terrible, and this code should not be added to production build! It is only useful to "hide" the warning.
A better solution would be to remove the file in question from the compilation, as it is anyway useless.
I had a the problem with this warning originating from several dependencies, and I found that it was caused by some translation unit being empty, i.e. empty source files.
These files actually had a content but it was deactivated for visual studio so I just added at the beginning:
__declspec( dllexport ) void getRidOfLNK4221(){}
And now my project compiles without any warning :)
Hope it helps, even if this is a late answer!