0

I have enabled pre-compiled headers in my VS solution, and correctly included stdafx.h in all code files. I am using the -Yc option in VS 2013.

Here is where it gets weird. When I build, the compiler generates the pre-compiled headers for each .cpp file it then builds. I know this because I added a "#pragma message("Compiling precompiled headers.")" message in the file and I see it in the output for every file.

Here is where it gets weirder. The same solution will work "properly" on my laptop. i.e. it builds the pre-compiled headers once, and only use. It worked "properly" on every other machine than my desktop.

I have tried this same solution and source on 4 machines, and only on one (mine) does it repeatedly compile the pre-compiled headers.

All machines are running VS Professional 2013 Update 1. Some machines are running Windows 7, some Windows 8.1. We are using the exact same source. There are of course probably some environment differences between the machines, but what option could be causing this?

Does anybody have any insight?

  • In the spirit of eliminating the obvious causes: have you tried to "really clean" your solution? Maybe there's some file around somewhere that is causing that build recursion? – YePhIcK Oct 05 '15 at 18:14
  • I would check if one of the files included in stdafx.h has its date corrupted on your desktop, specifically - set to a future date. – Vlad Feinstein Oct 05 '15 at 18:29
  • `-Yc` means Create precompiled header, and is used for stdafx.cpp only. All other files have option `-Yu` Use precompiled header. – Bo Persson Oct 05 '15 at 18:44
  • @BoPersson -- The flag is at a project level. -Yc will create then use, -Yu will use if its available. Regardless, the same code "is working" on other machines so I doubt its the compiler flag options. – Matt Goyder Oct 07 '15 at 16:25
  • @VladFeinstein -- This is a good idea, I was thinking along the lines of the compiler being fooled into thinking that the files were out of date. I will look at the file time-stamps. – Matt Goyder Oct 07 '15 at 16:26
  • 1
    @YePhIcK -- I delete the entire workspace and created a new one and re-downloaded the code. The environment is all checked in, there should be no local dependencies. This might just be the trigger for a new dev system that I needed anyways :) – Matt Goyder Oct 07 '15 at 16:27

0 Answers0