Troubleshooting an incomplete kwinject build specification
Troubleshooting an incomplete kwinject build specificationBuild specification contains only the version lineIf kwinject generated a build specification file that contained only the version line, kwinject was not able to recognize your compiler. Go to C/C++ compilers supported for build integration and look up your compiler type to see if it's supported.
For Visual Studio 2010 projects built on the command line, if the build specification contains only the version line, check for a stray msbuild.exe or mspdbsrv.exe process. If you find one, kill it before running kwinject. Build specification config line is missing or wrongIf you notice that the build specification contains an accurate compile line, but a config line is missing or wrong, kwinject has your build settings but still doesn't have a complete list of system includes or macro definitions necessary for an accurate build analysis. In this case, re-run kwinject with the --debug option and send the debug output to Customer Support, so that we can properly support your compiler. Binding your compiler name to a recognized compiler typeIf you know your compiler is one of the supported compiler types, but it has a nonstandard name, you need to bind your compiler's name to the compiler type recognized by kwinject.
Generate a build traceGenerate a build trace to get your exact compiler name. See Using a build trace to troubleshoot build specification problems.
Temporarily bind the compiler name to test itBind the name of the compiler temporarily to see if this resolves the issue.
Tip: In some cases, a single build environment may have multiple compilers or linkers (for example, gcc-x86, gcc-mips, and ar-mips). In this situation, just use multiple instances of the --prog option. For example:
kwinject --output myproject.out --prog gcc-x86=gnu --prog gcc-mips=gnu --prog ar-mips=ar make
Permanently bind the compiler name in the compiler mapping fileYou can edit the compiler mapping file, found at <klocwork_install>/config/kwfilter.conf, so that you don't have to pass the compiler name to kwinject with the --prog option each time you generate a build specification. Using the same example, we can add gcc-4.1 to kwfilter.conf. The line in kwfilter.conf controlling the GNU compiler type looks like this by default: # Default GNU C/C++ compiler We can edit it as follows: # Default GNU C/C++ compiler See Compiler mapping file format (kwfilter.conf) for more information. Tip: Make your custom kwfilter.conf file available to developers who are using Klocwork Desktop or kwcheck. Developers working in unsupported IDEs or text editors may need to configure their compilers as well. It will save time if they copy your custom kwfilter.conf file to their <user_install/config> directory.
|