I have a Visual Studio C++ based program that uses pre-compiled headers (stdafx.h). Now we are porting the application to Linux using gcc 4.x. 
The question is how to handle pre-compiled header in both environments. I've googled but can not come to a conclusion.
Obviously I want leave stdafx.h in Visual Studio since the code base is pretty big and pre-compiled headers boost compilation time.
But the question is what to do in Linux. This is what I found:
- Leave the stdafx.has is. gcc compiles code considerable faster than VC++ (or it is just my Linux machine is stronger ... :) ), so I maybe happy with this option.
- Use approach from here - make - stdafx.hlook like (set- USE_PRECOMPILED_HEADERfor VS only):- #ifdef USE_PRECOMPILED_HEADER ... my stuff #endif
- Use the approach from here - compile VC++ with - /FIto implicitly include- stdafx.hin each cpp file. Therefore in VS your code can be switched easily to be compiled without pre-compiled headers and no code will have to be changed.
 I personally dislike dependencies and the mess- stdafx.his pushing a big code base towards. Therefore the option is appealing to me - on Linux you don't have- stdafx.h, while still being able to turn on pre-compiled headers on VS by- /FIonly.
- On Linux compile stdafx.honly as a precompiled header (mimic Visual Studio)
Your opinion? Are there other approaches to treat the issue?
 
     
     
     
     
     
     
     
     
     
     
    