views:

48

answers:

2

I work as the Mac coder on a c++ application which I share with PC coders who use VS2008. When they make changes to a source file that requires an non-included header file they get no warnings, as most of their headers are in a precompiled header. What setting can they use to have them be warned that they failed to add the required include?

Would make my life easier as GCC requires the includes be actually present.

A: 

I would make the precompiled headers conditional on a define that is only present on the PC code, or vice versa for the mac code.

Preet Sangha
+2  A: 

Er... Your question as stated is based on an incorrect premise.

All headers in VS compiler are required to be included. There's no way around it.

Precompiled headers feature does not affect this general principle it any way. The only difference is that in projects that plan to use precompiled headers the headers are normally included indirectly, through a special intermediate header file. Nevertheless, you can't just forget to include some header file, regardless of whether the project is using precompiled headers or not. All headers must be included in all cases, directly or indirectly.

A project that's using precompiled headers will compile perfectly fine on any compiler that knows nothing about any precompiled headers at all.

So, the situation you describe simply cannot happen in practice. If it does, they you must be leaving out some important detail about the problem.

AndreyT
Hmm, the Intel compiler is what they usually use, I was incorrect in thinking it was the VC++ compiler.
codist
If that is the difference my question I guess is with the Intel compiler options. Either way the problem is that when I compile on Mac I get errors which I can only fix by finding and adding the correct header to the source file; yet they never notice there is something missing.
codist