fsharp/fsharpbinding — Issue #24: Cann't compile fshaprbinding.
Author: o01eg
Created: 2011-10-23 13:48:58+00:00
State: open

I use next patch to use .NET 4.0 and to fix error with Mono.Unix:

```patch
--- configure.sh	2011-07-23 11:32:58.000000000 +0400
+++ configure.sh	2011-07-23 11:36:06.226984026 +0400
@@ -23,7 +23,5 @@
echo ""
echo "Press enter to continue..."

-read a
-
# ------------------------------------------------------------------------------
# Parse command line arguments and specify default values
@@ -83,12 +81,12 @@
MDDIR=$RESULT
echo "Successfully found MonoDevelop root directory." $MDDIR

-PATHS=( /usr/lib/fsharp /usr/local/lib/fsharp /opt/mono/lib/mono/2.0 )
+PATHS=( /usr/lib/mono/4.0 /usr/lib/fsharp )
searchpaths "F#" FSharp.Core.dll PATHS[@]
FSDIR=$RESULT
echo "Successfully found F# root directory." $FSDIR

-PATHS=( /usr/lib/mono/2.0 /Library/Frameworks/Mono.framework/Versions/2.8/lib/mono/2.0 /opt/mono/lib/mono/2.0 )
+PATHS=( /usr/lib/mono/4.0 )
searchpaths "Mono" mscorlib.dll PATHS[@]
MONODIR=$RESULT
echo "Successfully found Mono root directory." $MONODIR
@@ -135,3 +132,4 @@
sed "s,INSERT_CSHARP_COMPILER,$GMCS,g" Makefile.1 > Makefile.2
rm Makefile.1
mv Makefile.2 Makefile
+
--- Makefile.orig	2011-07-29 19:16:55.000000000 +0400
+++ Makefile.orig	2011-07-29 19:18:10.000000000 +0400
@@ -59,5 +59,5 @@
REFERENCES = \
-r:$(MONOBIN)/mscorlib.dll \
-	-r:System.dll -r:System.Xml.dll \
+	-r:System.dll -r:System.Xml.dll -r:Mono.Posix.dll \
-r:$(MDBIN)/MonoDevelop.Core.dll \
-r:$(MDBIN)/MonoDevelop.Ide.dll \
--- src/Services/FSharpCompiler.fs	2011-07-29 19:16:55.000000000 +0400
+++ src/Services/FSharpCompiler.fs	2011-07-29 19:18:10.000000000 +0400
@@ -74,7 +74,7 @@

/// Wrapper type for the 'FSharp.Compiler.dll' assembly - expose types we use
type FSharpCompiler private () =
- static let asm = Assembly.Load("FSharp.Compiler, Version=2.0.0.0, Culture=neutral, PublicKeyToken=a19089b1c74d0809")
+ static let asm = Assembly.Load("FSharp.Compiler, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
static member InteractiveChecker = asm.GetType("Microsoft.FSharp.Compiler.SourceCodeServices.InteractiveChecker")
static member IsResultObsolete = asm.GetType("Microsoft.FSharp.Compiler.SourceCodeServices.IsResultObsolete")
static member CheckOptions = asm.GetType("Microsoft.FSharp.Compiler.SourceCodeServices.CheckOptions")
@@ -84,7 +84,7 @@

/// Wrapper type for the 'FSharp.Compiler.Server.Shared.dll' assembly - expose types we use
type FSharpCompilerServerShared private () =
- static let asm = Assembly.Load("FSharp.Compiler.Server.Shared, Version=2.0.0.0, Culture=neutral, PublicKeyToken=a19089b1c74d0809")
+ static let asm = Assembly.Load("FSharp.Compiler.Server.Shared, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
static member InteractiveServer = asm.GetType("Microsoft.FSharp.Compiler.Server.Shared.FSharpInteractiveServer")

// --------------------------------------------------------------------------------------
```

But when I compile I'm getting next errors:

```log
Successfully found MonoDevelop root directory. /usr/lib/monodevelop
Successfully found F# root directory. /usr/lib/mono/4.0
Successfully found Mono root directory. /usr/lib/mono/4.0
Successfully found Gtk# root directory. /usr/lib/mono/gtk-sharp-2.0
Successfully found Glib# root directory. /usr/lib/mono/gtk-sharp-2.0
Successfully found Atk# root directory. /usr/lib/mono/gtk-sharp-2.0
Successfully found Gdk# root directory. /usr/lib/mono/gtk-sharp-2.0
Successfully found Pango root directory. /usr/lib/mono/gtk-sharp-2.0
>>> Source configured.
>>> Compiling source in /tmp/portage/dev-dotnet/fsharpbinding-9999/work/fsharpbinding-9999 ...
make -j5
mkdir -p bin
gmcs -debug+ -out:bin/FSharpBinding.Gui.dll -target:library -r:/usr/lib/mono/4.0/mscorlib.dll -r:System.dll -r:System.Xml.dll -r:Mono.Posix.dll -r:/usr/lib/monodevelop/bin/MonoDevelop.Core.dll -r:/usr/lib/monodevelop/bin/MonoDevelop.Ide.dll -r:/usr/lib/monodevelop/bin/Mono.TextEditor.dll -r:/usr/lib/mono/4.0/FSharp.Core.dll -r:/usr/lib/mono/4.0/FSharp.Compiler.dll -r:/usr/lib/mono/4.0/FSharp.Compiler.Interactive.Settings.dll -r:/usr/lib/mono/4.0/FSharp.Compiler.Server.Shared.dll -r:/usr/lib/mono/gtk-sharp-2.0/atk-sharp.dll -r:/usr/lib/mono/gtk-sharp-2.0/pango-sharp.dll -r:/usr/lib/mono/gtk-sharp-2.0/gtk-sharp.dll -r:/usr/lib/mono/gtk-sharp-2.0/gdk-sharp.dll -r:/usr/lib/mono/gtk-sharp-2.0/glib-sharp.dll src/Gui/FSharpBuildOrderWidget.cs src/Gui/FSharpSettingsWidget.cs src/Gui/FSharpCompilerOptionsWidget.cs src/Gui/gtk-gui/FSharp.MonoDevelop.Gui.FSharpBuildOrderWidget.cs src/Gui/gtk-gui/FSharp.MonoDevelop.Gui.FSharpSettingsWidget.cs src/Gui/gtk-gui/FSharp.MonoDevelop.Gui.FSharpCompilerOptionsWidget.cs src/Gui/gtk-gui/generated.cs
fsharpc --noframework --debug --optimize- --target:library -r:bin/FSharpBinding.Gui.dll --out:bin/FSharpBinding.dll -r:/usr/lib/mono/4.0/mscorlib.dll -r:System.dll -r:System.Xml.dll -r:Mono.Posix.dll -r:/usr/lib/monodevelop/bin/MonoDevelop.Core.dll -r:/usr/lib/monodevelop/bin/MonoDevelop.Ide.dll -r:/usr/lib/monodevelop/bin/Mono.TextEditor.dll -r:/usr/lib/mono/4.0/FSharp.Core.dll -r:/usr/lib/mono/4.0/FSharp.Compiler.dll -r:/usr/lib/mono/4.0/FSharp.Compiler.Interactive.Settings.dll -r:/usr/lib/mono/4.0/FSharp.Compiler.Server.Shared.dll -r:/usr/lib/mono/gtk-sharp-2.0/atk-sharp.dll -r:/usr/lib/mono/gtk-sharp-2.0/pango-sharp.dll -r:/usr/lib/mono/gtk-sharp-2.0/gtk-sharp.dll -r:/usr/lib/mono/gtk-sharp-2.0/gdk-sharp.dll -r:/usr/lib/mono/gtk-sharp-2.0/glib-sharp.dll --resource:src/Resources/FSharpBinding.addin.xml --resource:src/Resources/EmptyFSharpSource.xft.xml --resource:src/Resources/EmptyFSharpScript.xft.xml --resource:src/Resources/FSharpConsoleProject.xpt.xml --resource:src/Resources/fsharp-icon-32.png --resource:src/Resources/fsharp-script-32.png --resource:src/Resources/fsharp-file-icon.png --resource:src/Resources/fsharp-project-icon.png --resource:src/Resources/fsharp-script-icon.png --resource:src/Resources/FSharpSyntaxMode.xml src/PowerPack/CodeDomVisitor.fs src/PowerPack/CodeDomGenerator.fs src/PowerPack/CodeProvider.fs src/PowerPack/LazyList.fsi src/PowerPack/LazyList.fs src/Services/Mailbox.fs src/Services/Parameters.fs src/Services/FSharpCompiler.fs src/Services/CompilerLocationUtils.fs src/Services/Common.fs src/Services/Parser.fs src/Services/LanguageService.fs src/Services/CompilerService.fs src/Services/InteractiveSession.fs src/FSharpInteractivePad.fs src/FSharpOptionsPanels.fs src/FSharpSyntaxMode.fs src/FSharpResourceIdBuilder.fs src/FSharpLanguageBinding.fs src/FSharpParser.fs src/FSharpTextEditorCompletion.fs src/FSharpResolverProvider.fs
Microsoft (R) F# 2.0 Compiler build (private)
Copyright (c) 2002-2010 Microsoft Corporation. All Rights Reserved.

/tmp/portage/dev-dotnet/fsharpbinding-9999/work/fsharpbinding-9999/src/PowerPack/CodeDomGenerator.fs(248,44): warning FS0044: This construct is deprecated

/tmp/portage/dev-dotnet/fsharpbinding-9999/work/fsharpbinding-9999/src/Services/Parameters.fs(45,14): error FS0855: No abstract or interface member was found that corresponds to this override

/tmp/portage/dev-dotnet/fsharpbinding-9999/work/fsharpbinding-9999/src/Services/Parameters.fs(51,14): error FS0855: No abstract or interface member was found that corresponds to this override

/tmp/portage/dev-dotnet/fsharpbinding-9999/work/fsharpbinding-9999/src/Services/Common.fs(11,11): error FS0039: The namespace 'Addins' is not defined

/tmp/portage/dev-dotnet/fsharpbinding-9999/work/fsharpbinding-9999/src/Services/Common.fs(381,39): error FS0039: The namespace or module 'AddinManager' is not defined

/tmp/portage/dev-dotnet/fsharpbinding-9999/work/fsharpbinding-9999/src/Services/Common.fs(383,9): error FS0039: The namespace or module 'AddinManager' is not defined

/tmp/portage/dev-dotnet/fsharpbinding-9999/work/fsharpbinding-9999/src/Services/Common.fs(397,39): error FS0039: The namespace or module 'AddinManager' is not defined

/tmp/portage/dev-dotnet/fsharpbinding-9999/work/fsharpbinding-9999/src/Services/Common.fs(399,9): error FS0039: The namespace or module 'AddinManager' is not defined

/tmp/portage/dev-dotnet/fsharpbinding-9999/work/fsharpbinding-9999/src/FSharpSyntaxMode.fs(10,21): error FS1108: The type 'Context' is required here and is unavailable. You must add a reference to assembly 'Mono.Cairo, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756'.
make: *** [all] Error 1
emake failed
```

I use Gentoo amd64, mono-2.10.5, monodevelop-2.6 and last fsharp from master branch.