1 .TH mbas 1 "21 February 2006"
3 mbas \- Mono Basic Compiler.
6 [option] [source-files]
10 is a CIL compiler for the VisualBasic.NET language, an
11 extended version of Visual Basic.
13 Applications developed on Windows with vbc can execute on Mono and applications
14 compiled with 'mbas' can be executed on .NET runtime.
16 The Mono Basic compiler accepts the same options as
17 the Microsoft VB.NET compiler. Those options can start with a slash or a
18 dash (/checked is the same as -checked). Additionally to this, the
19 GNU-like options are supported, those begin with "--". All
20 -specific flags which are not available in the Microsoft VB.NET
21 compiler are available only with the GNU-style options.
23 Visual Basic.NET source files must end with a ".vb" extension. Compilation of
24 VB.NET source code requires all the files that make up a library, module or
25 executable to be provided on the command line. There is no support
26 for partial compilation. To achieve the benefits of partial
27 compilation, you should compile programs into their own assemblies,
28 and later reference them with the "-r" flag.
30 The Mono Basic compiler generates images (.exe files) that contain
31 CIL byte code that can be executed by any system that implements a Common
32 Language Infrastructure virtual machine such as the Microsoft .NET
33 runtime engine on Windows or the Mono runtime engine on Unix systems.
34 Executables are not bound to a specific CPU or operating system.
36 The Mono Basic compiler by default only references three assemblies:
37 mscorlib.dll, System.dll and System.Xml.dll. If you want to
38 reference extra libraries you must manually specify them using the
39 -pkg: command line option or the -r: command line option.
40 Alternatively if you want to get all of the System libraries, you can
41 use the -pkg:dotnet command line option.
46 Displays information about the Mono Basic compiler
48 .I \-\-addmodule:MODULE1[,MODULE2]
49 Includes the specified modules in the resulting assembly.
52 Specifies the code page used to process the input files from the
53 point it is specified on. By default files will be processed in the
54 Latin-1 code page. The compiler will also automatically detect
55 Unicode files that have an embedded byte mark at the beginning.
57 Other popular encodings are 28591 (Latin1), 1252 (iso-8859-1) and 65001 (UTF-8).
59 Mono Basic supports a couple of shorthands: "utf8" can be used to specify utf-8 instead
60 of using the cryptic 65001 and "reset" restores the automatic handling of
61 code pages. These shorthands are not available on the Microsoft compiler.
63 .I \-define:SYMLIST, -d:SYMLIST
64 Defines the symbol listed by the semi-colon separeted list SYMLIST
65 SYMBOL. This can be tested in the source code by the pre-processor,
66 or can be used by methods that have been tagged with the Conditional
69 .I \-debug-args:arguments
73 Specify the amount of debugging information to emit. Possible values for
74 AMOUNT are "full" and "pdbonly".
76 .I \-~, \-debugoptions
77 Show debugging info while processing options.
80 This is used for debugging the compiler. This makes the error emission
81 generate an exception that can be caught by a debugger.
83 .I \-imports:import-list
84 Declare global Imports for listed namespaces.
87 Ignores warning number XXXX.
89 .I -lib:PATHLIST, -libpath:PATHLIST
90 Each path specified in the comma-separated list will direct the
91 compiler to look for libraries in that specified path.
94 Directs the compiler to look for libraries in the specified path.
95 Multiple paths can be provided by using the option multiple times.
98 Tells the compiler which CLASS or MODULE contains the entry point. Useful when
99 you are compiling several classes with a Main method.
102 Suppress printing copyright information on startup.
104 .I \-nostdlib, -nostdlib+
105 Use this flag if you want to compile the core library. This makes the
106 compiler load its internal types from the assembly being compiled.
108 .I \-noconfig, \-noconfig+
109 Disables the default compiler configuration to be loaded. The
110 compiler by default has references to the system assemblies.
113 Makes the compiler ignore warnings.
115 .I \-optioncompare:binary, \-optioncompare:text
116 Select between binary and text string comparisons. The default is binary
119 .I \-optionexplicit[+|-]
120 Require explicit declaration of variables
122 .I \-optionstrict[+|-]
123 Enforce strict language semantics
125 .I \-out:FNAME, -o FNAME
126 Names the output file to be generated.
129 Used for benchmarking. The compiler will only parse its input files.
132 .I \-pkg:package1[,packageN]
133 The compiler will invoke pkg-config --libs on the set of packages
134 specified on the command line to obtain libraries and directories to
137 This is typically used with third party components, like this:
139 $ mbas -pkg:gtk-sharp demo.vb
144 This will instruct the compiler to reference the System.* libraries
145 available on a typical dotnet framework installation, notice that this
146 does not include all of the Mono libraies, only the System.* ones. This
147 is a convenient shortcut for those porting code.
150 Commands the compiler to show only error messages for syntax-related errors
153 .I -resource:RESOURCE[,ID]
154 Embeds to the given resource file. The optional ID can be used to
155 give a different name to the resource. If not specified, the resource
156 name will be the file name.
158 .I -linkresource:RESOURCE[,ID]
159 Links to the specified RESOURCE. The optional ID can be used to give
160 a name to the linked resource.
162 .I -r:ASSEMBLY1[,ASSEMBLY2], \-r ASSEMBLY1[,ASSEMBLY2]
163 Reference the named assemblies. Use this to use classes from the named
164 assembly in your program. The assembly will be loaded from either the
165 system directory where all the assemblies live, or from the path
166 explicitly given with the -L option.
168 You can also use a semicolon to separate the assemblies instead of a
171 .I \-removeintchecks[+|-]
172 Remove integer checks. Default off.
174 .I \-rootnamespace:namespace
175 Specifies the root namespace for all type declarations
178 Generates a stack trace at the time the error is reported, useful for
179 debugging the compiler.
181 .I \-target:KIND, \-t:KIND
182 Used to specify the desired target. The possible values are: exe
183 (plain executable), winexe (Windows.Forms executable), library
184 (component libraries) and module (partial library).
187 Another debugging flag. Used to display the times at various points
188 in the compilation process.
191 Only tokenizes source files. Currently ignored.
193 .I \-unsafe, -unsafe+
194 Enables compilation of unsafe code.
197 Emit compiler output in UTF8 character encoding. Currently ignored.
200 Debugging. Turns on verbose yacc parsing.
202 .I -. -verbosegetoptions
203 Show verbose parsing of options
206 Shows the compiler version.
208 .I \-warnaserror, \-warnaserror+
209 Treat warnings as errors.
212 Sets the warning level. 0 is the lowest warning level, and 4 is the
213 highest. The default is 2.
216 Use this to stop option parsing, and allow option-looking parameters
217 to be passed on the command line.
219 As of early 2006, the Mono Basic compiler is still considered alpha software.
220 Several language constructions that are accepted by the Microsoft Visual
221 Basic.NET compiler are refused by the Mono Basic compiler. Occassional
222 crashes also still occur.
225 See the ChangeLog for authors
228 The Mono Basic compiler is released under the terms of the GNU GPL.
229 Please read the accompanying `COPYING' file for details. Alternative
230 licenses are available from Ximian.
233 mcs(1), mono(1), mint(1), sn(1)
236 To report bugs in the compiler, you can use `bug-buddy', or you can
237 file bug reports in our bug tracking system:
238 http://bugzilla.ximian.com.
240 The Mono Basic Mailing List is available at: mono-vb-list-request@ximian.com