Show/Hide Toolbars

XSharp

Navigation: X# Documentation > X# Compiler Options

X# Compiler Options By Category

Scroll Prev Top Next More

The following compiler options are sorted by category. For an alphabetical list, see : X# Compiler Options Listed Alphabetically

Dialect support

Option

Purpose

-dialect

Specifies the dialect to use when compiling. The following values are supported: Core, VO, Vulcan, dBase, FoxPro, Xbase++ and Harbour. Work on the VO and Vulcan dialects has started.

XBase Compatibility

Option

Purpose

-allowdot

Allow the DOT (.) character as operator for instance members

-allowoldstyleassignments

Allow assignments with a single Equals operator (=)

-az

Specifies that arrays are zero-based rather than one-based

-cs

Specifies that the compiler should use case-sensitive type names

-d

Instruct the compiler to emit debugging information. (short for /debug)

-enforceoverride

Enforce the use of the OVERRIDE keyword to override methods from parent classes in subclasses

-enforceself

Enforce the use of SELF: to access fields, properties and methods inside a class

-fovf

Specifies that exceptions will be raised on invalid floating point operations

-fox1

Obsolete

-fox2

Fompatible FoxPro Array support

-i

Specifies a directory to add to the #include file search path

-initlocals

Initialize all local variables

-ins

Use implicit namespace lookup mechanism

-lb

Specifies that the compiler should generate late bound calls when necessary

-memvar

Enables support for memory variables

-modernsyntax

Disable certain legacy compiler options

-namedargs

Specifies whether to allow named arguments in the parser or not.

-noinit

Suppress generation of empty $Init1() and  $Exit() functions

-norun

Obsolete compiler option in X#, inherited from Vulcan. To achieve this simply remove the references to the runtime DLLs and compile in the Core dialect

-nostddefs

Suppresses preprocessor definitions in XSharpDefs.xh

-ns

Specify the default namespace for the output assembly

-ovf

Specifies that exceptions will be raised on integer overflows

-showincludes

Lists #include files in compiler output

-snk

Signs assembly with strong name key pair

-undeclared

Enables support for undeclared variables

-vo1

Use Init and Axit methods in stead of Constructors and Destructors

-vo2

Initialize STRING variables, fields and DIM arrays to empty strings

-vo3

Treats All Methods As VIRTUAL

-vo4

Allows implicit signed/unsigned integer conversions

-vo5

Implicit CLIPPER Calling Convention for Zero-Argument Functions

-vo6

Resolves typed function pointers to PTR

-vo7

Allows compatible implicit casts and conversions

-vo8

Enables compatible preprocessor behavior

-vo9

Allows missing RETURN statements

-vo10

Enables compatible IIF behavior

-vo11

Enables Visual Objects compatible arithmetic conversions

-vo12

Enables Clipper compatible integer divisions

-vo13

Enables Visual Objects compatible string comparisons

-vo14

Insert floating point literals as FLOAT

-vo15

Allow untyped Locals and return types

-vo16

Automatically generate Clipper calling convention constructors for classes without constructor

-w

This option is not supported. use -NoWarn in stead

-wx

Treats all warnings as errors (alias for -warnaserror)

-xpp1

All classes inherit from the Abstract class

Optimization

Option

Purpose

-filealign

Specifies the size of sections in the output file.

-optimize

Enables/disables optimizations.

Output files

Option

Purpose

-doc

Specifies an XML file where processed documentation comments are to be written.

-modulename

Specify the name of the source module

-out

Specifies the output file.

-pathmap

Specify a mapping for source path names output by the compiler.

-pdb

Specifies the file name and location of the .pdb file.

-platform

Specify the output platform.

-preferreduilang

Specify a language for compiler output.

-target

Specifies the format of the output file using one of five options: /target:appcontainerexe, /target:exe, /target:library, /target:module, /target:winexe, or /target:winmdobj.

-touchedfiles

Specify filename that will be updated with list of files read and written by the compiler

.NET Assemblies

Option

Purpose

-analyzer

Run the analyzers from this assembly (Short form: /a)

-additionalfile

Names additional files that don't directly affect code generation but may be used by analyzers for producing errors or warnings.

-addmodule

Specifies one or more modules to be part of this assembly.

-delaysign

Instructs the compiler to add the public key but to leave the assembly unsigned.

-keycontainer

Specifies the name of the cryptographic key container.

-keyfile

Specifies the filename containing the cryptographic key.

-lib

Specifies the location of assemblies referenced by means of /reference.

-nostdlib

Instructs the compiler not to import the standard library (mscorlib.dll).

-reference

Imports metadata from a file that contains an assembly.

Debugging / Error checking

Option

Purpose

-ast

Dump the abstract syntax tree for each source file (.ast extension)

-checked

Specifies whether integer arithmetic that overflows the bounds of the data type will cause an exception at run time.

-debug

Instruct the compiler to emit debugging information.

-errorendlocation

Output line and column of the end location of each error

-errorreport

Sets error reporting behavior.

-fullpaths

Specifies the absolute path to the file in compiler output.

-lexonly

Tells the compiler to only lex the source code.

-nowarn

Suppresses the compiler's generation of specified warnings.

-parseonly

This compiler option tells the compiler to lex and parse the code.

-ruleset

Specify a ruleset file that disables specific diagnostics.

-warn

Sets the warning level.

-warnaserror

Promotes warnings to errors.

-wx

This is an alias for the -warnaserror option

Preprocessor

Option

Purpose

-define

Defines preprocessor symbols.

-i

Specifies a directory to add to the #include file search path

-ppo

Writes preprocessor output to file

-nostddef

Suppresses preprocessor definitions in XSharpDefs.xh  

-showdefs

Show the defines that are added from the header files and their usage

-showincludes

Lists #include files in compiler output

-verbose

Shows includes, source file names, defines and more. on the console

Resources

Option

Purpose

-link

Makes COM type information in specified assemblies available to the project.

-linkresource

Creates a link to a managed resource.

-resource

Embeds a .NET Framework resource into the output file.

-usenativeversion

Prefer native resource (if any) over resources generated from managed assembly properties

-win32icon

Specifies an .ico file to insert into the output file.

-win32res

Specifies a Win32 resource to insert into the output file.

Miscellaneous

Option

Purpose

@

Specifies a response file.

-?

Lists compiler options to stdout.

-appconfig

Specify an application configuration file containing assembly binding settings

-baseaddress

Specifies the preferred base address at which to load a DLL.

-checksumalgorithm

Specify the algorithm for calculating the source file checksum stored in PDB. Supported values are: SHA1 (default) or SHA256.

-codepage

Specifies the code page to use for all source code files in the compilation.

-help

Lists compiler options to stdout.

-highentropyva

Specifies that the executable file supports address space layout randomization (ASLR).

-langversion

Specify language version mode: core, VO, Vulcan, Harbour, FoxPro, dBase

-main

Specifies the location of the Main method.

-noconfig

Instructs the compiler not to compile with xsc.rsp.

-nologo

Suppresses compiler banner information.

-parallel

Specifies whether to use concurrent build (+).

-recurse

Searches subdirectories for source files to compile.

-s

Syntax check only

-shared

Use the shared compiler

-subsystemversion

Specifies the minimum version of the subsystem that the executable file can use.

-unsafe

Enables compilation of code that uses the unsafe keyword.

-utf8output

Displays compiler output using UTF-8 encoding.

-win32manifest

Specify a user-defined Win32 application manifest file to be embedded into a executable file.