开发者

Compiling F# code on Mono 2.8

I've been trying to compile some F# code with Mono 2.8 in OpenSuSe 11.3. And I keep running into trouble, I'm currently getting this error thrown at me:

parameter error FS0219: The referenced or default base CLI library 'mscorlib' is 
binary-incompatible with the referenced F# core library '/home/fredrik/Documents/
FSharp-2.0.0.0/FSharp-2.0.0.0/bin/FS开发者_如何学编程harp.Core.dll'. Consider recompiling the 
library or making an explicit reference to a version of this library that matches 
the CLI version you are using.

Using these options to the fsharp compiler:

mono fsc.exe -o:FSKit.dll -g --debug:full --noframework --define:DEBUG 
--define:TRACE --optimize- --tailcalls- --platform:x86 -r:"FSharp.Core.dll" 
-r:"/usr/lib/mono/4.0/mscorlib.dll" -r:"/usr/lib/mono/4.0/System.Core.dll" 
-r:"/usr/lib/mono/4.0/System.dll" --target:library --warn:3 --warnaserror:76 
--vserrors --LCID:1033 --utf8output --fullpaths --flaterrors Src/Version.fs 
Src/Bit.fs Src/Reflection.fs Src/Perf.fs Src/Stream.fs Src/AssemblyInfo.fs

After installing FSharp from the fsharp.zip file found here and running ./install-mono.sh: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=f8c623ae-aef6-4a06-a185-05f59be47d67&displaylang=en

Do I need to compile FSharp.Core.dll with mono also?


I think that the CTP version of F# is available only for .NET 2.0 based runtime (i.e. from .NET 2.0 to .NET 3.5), so there is no stand-alone installation for .NET 4.0. Since the assembly format differs a little bit, you'll probably need to use 2.0 version of Mono libraries.

I think that referencing libraries from /usr/lib/mono/2.0 should fix the problem.

And BTW, there is a project to create Linux and Mac packages for F#. Using the ZIP file and install script definitely works, but installing a package may be an easier option:

  • F# cross-platform samples and packages
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜