2010-10-21 50 views
3

我一直试图在OpenSuSe 11.3中用Mono 2.8编译一些F#代码。而且我一直运行到麻烦,目前我得到这个错误扔给我:在Mono 2.8上编译F#代码

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/FSharp.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. 

使用这些选项的fsharp编译:

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 

从发现fsharp.zip文件安装FSharp后这里和运行./install-mono.sh:http://www.microsoft.com/downloads/en/details.aspx?FamilyID=f8c623ae-aef6-4a06-a185-05f59be47d67&displaylang=en

我需要用mono编译FSharp.Core.dll吗?

回答

3

我认为C#版本的F#仅适用于基于.NET 2.0的运行时(即从.NET 2.0到.NET 3.5),因此不存在.NET 4.0的独立安装。由于汇编格式稍有不同,您可能需要使用2.0版本的Mono库。

我认为从/usr/lib/mono/2.0引用库应该可以解决这个问题。

另外,还有一个为F#创建Linux和Mac软件包的项目。使用ZIP文件和安装脚本肯定能行,但安装包可能是更容易的选择:

+0

你是正确的,谢谢:) – thr 2010-10-22 13:04:13