distutils.ccompiler.CCompiler_compile(self, sources, output_dir=None, macros=None, include_dirs=None, debug=0, extra_preargs=None, extra_postargs=None, depends=None)[source]#

Compile one or more source files.

Please refer to the Python distutils API reference for more details.

sourceslist of str

A list of filenames

output_dirstr, optional

Path to the output directory.

macroslist of tuples

A list of macro definitions.

include_dirslist of str, optional

The directories to add to the default include file search path for this compilation only.

debugbool, optional

Whether or not to output debug symbols in or alongside the object file(s).

extra_preargs, extra_postargs?

Extra pre- and post-arguments.

dependslist of str, optional

A list of file names that all targets depend on.

objectslist of str

A list of object file names, one per source file sources.


If compilation fails.