Reputation: 920
I have an installation of mono 2.10.4 on linux and have been attempting to compile a .NET C# 4 dependent codebase. I have been able to compile in MonoDevelop, but need to be able to do from the command line / build tool.
executing:
gmcs -langversion:4 -target:library -out:foo.dll ... <sources>
produces the following error:
error CS1617: Invalid -langversion option `4'. It must be `ISO-1', `ISO-2', `3'
or `Default'
The compiler version gmcs --version
:
Mono C# compiler version 2.10.4.0
Further notes:
Upvotes: 4
Views: 3946
Reputation: 1500515
I think you want to run dmcs
instead of gmcs
. From the CSharp Compiler page:
Starting with Mono version 2.6 a new compiler dmcs is available as a preview of C# 4.0 (a preview since Mono 2.6 will ship before C# 4.0 is finalized).
(That's a little out of date as I'm now running 2.10.5.0, but never mind.)
EDIT: Alternative, use mcs
as specified here, as you're running 2.10.
It doesn't support a specific -langversion
of 4, but then neither does the Microsoft compiler:
/langversion:<string> Specify language version mode: ISO-1, ISO-2, 3, or Default
Upvotes: 7