Linker options for kwbuildproject

This page documents options that control the Klocwork C/C++ linker, kwlinker. They can be applied to kwbuildproject through the option --add-linker-options:

kwbuildproject --tables-directory <dir> --add-linker-options <linker-options> <build_specification1> [<build_specification2>...]

To pass multiple linker options, separate them by spaces, and surround the entire string in quotation marks. For example:

--add-linker-options "--object-oriented --external-relation C:\Klocwork\relations.rel"

Verbosity and help options

Name (and short name) Description
--progress (-p) print linker progress (as percentage completed)
--verbose (-v) print verbose information about program execution, which can help to troubleshoot errors
--verbose-exec print arguments of the executed external programs

General analysis options

Option Description
--lef-config <xml file> Specify logic errors finder configuration in <xml file>
--lm-server <host:port> Specify the License Server host name and port number. The default host is localhost; the default port number is 27000.
--no-resolve Do not resolve path to the file if it is linked, resolve paths to directories
--object-file-list <file> Specify file containing list of object files

Options for specifying input and output

Name (and short name) Description
-D <obj-dir> specify the object files directory. Note that you can use multiple instances of the -D option to point to different directories.
-o <table-dir> specify the output directory for the Klocwork tables
--object-file-list <list-file> (-s) specify the file(s) containing a list of object files to process. This option can be used multiple times in one command line.
--restriction-list <file> specify a list of object files for logical error finder section. Related to incremental analysis.

Options for extra features

Option Description
--replace-path <old>=<new> This option should no longer be used; instead, use the kwbuildproject option --replace-path. See Replacing the path to your source files.

Other ways to specify object files

You can substitute <object files> with the linker option -D <object files directory> if you have placed all your object files in a specific directory. Note that you can use multiple instances of the -D option to point to different directories.

Or, you can create a file containing paths to all of your object files and use the --object-file-list <file> option to point to it.

Related Topics Link IconSee also