Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Precompiled Header and MSBuild

I have a precompiled header that needs to be included atop each .cpp in my project. I fear that I will waste a lot of time explaining and fixing that in coworkers code.

Is there an MSBuild step that I can do to #include "stdafx.h" at the top of all my .cpp files so it dosen't need to do done manually?

like image 753
Jonathan Mee Avatar asked Jul 16 '26 10:07

Jonathan Mee


1 Answers

You have the compiler option /FI pathname

which virtually add #include "pathname" at the first line of the file.

Note: the equivalent for gcc is -include path.

like image 183
Jarod42 Avatar answered Jul 18 '26 00:07

Jarod42