Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

My project doesn't build when I turn pch off

LegacyForum
LegacyForum Posts: 1,664 ✭✭
edited December 2016 in Insure++
Sometimes a project that uses precompiled headers fails to compile or link under Insure++. For such projects, it is sometimes necessary to turn pch off when instrumenting your code with Insure++.

However, some projects will only build if PCH is turned on. Such projects are broken. They are usually just poorly configured and should be fixed. Usually the breakage is missing or inconsistent use of /I command line switches at compile time. In such cases, either no stdafx.h is found, or the wrong one is on the INCLUDE path, and the compilation of some object fails. Simply fixing the /I paths to be consistent is enough to fix such projects.

PCH should be a speed optimization only. There is no good reason that I know of to configure a project in such a way that it only builds if pch is in use.

Projects broken in such ways will not build under Insure++ if pch is disabled, just as they will not build under your normal compiler if pch is disabled.