Reputation: 805
Had hoped that this would help, but getting a different error.
attempting to compile the following as hello.cs
using Gtk;
using System;
class Hello
{
static void Main()
{
Application.Init();
Window window = new Window("helloworld");
window.Show();
Application.Run();
}
}
Compiling with the following command "gmcs hello.cs -pkg:gtk-sharp-2.0"
depending on the command prompt, I'm receiving either cs0006 (mono cp) or cs2001 (win cp) saying that files cannot be found from mono cp it says that the metadata file cannot be found from win cp it says that source file cannot be found
Here's a sample:
c:\Users\Stephen Lloyd\Desktop>gmcs hello.cs -pkg:gtk-sharp-2.0
-r:C:/Program Files \(x86\)/Mono-2.10.8/lib/mono/gtk-sharp-2.0/pango-sharp.dll \(x86\)/Mono-2.10.8/lib/mono/gtk-sharp-2.0/atk-sharp.dll \(x86\)/Mono-2.10.8/lib/mono/gtk-sharp-2.0/gdk-sharp.dll \(x86\)/Mono-2.10.8/lib/mono/gtk-sharp-2.0/gtk-sharp.dll \(x86\)/Mono-2.10.8/lib/mono/gtk-sharp-2.0/glib-sharp.dll
error CS2001: Source file `Files' could not be found
error CS2001: Source file `\(x86\)/Mono-2.10.8/lib/mono/gtk-sharp-2.0/pango-sharp.dll' could not be found
error CS2001: Source file `\(x86\)/Mono-2.10.8/lib/mono/gtk-sharp-2.0/atk-sharp.dll' could not be found
error CS2001: Source file `\(x86\)/Mono-2.10.8/lib/mono/gtk-sharp-2.0/gdk-sharp.dll' could not be found
error CS2001: Source file `\(x86\)/Mono-2.10.8/lib/mono/gtk-sharp-2.0/gtk-sharp.dll' could not be found
error CS2001: Source file `\(x86\)/Mono-2.10.8/lib/mono/gtk-sharp-2.0/glib-sharp.dll' could not be found
Compilation failed: 6 error(s), 0 warnings
In all cases the referenced .dlls are in that folder.
Any thoughts?
Upvotes: 5
Views: 3650
Reputation: 11
I was having the same problem running this on Windows 10. Since Windows supports symbolic links, since Vista, I thought this might be a solution ... it worked for me.
As Administrator, I created a directory symbolic link from the root directory to mono:
cd \
mklink /d mono "\program files x(86)\mono"
Then, again as Administrator, I edited the "Open Mono Command Prompt" shortcut properties:
Target: C:\Windows\SysWOW64\cmd.exe /k "C:\Mono\\bin\setmonopath.bat"
Start In: C:\Mono
Now when pkg-config
parses the drive-path of mono.exe it "sees" only c:\mono
and will proceed to append the rest of the path to resolve the required packages.
You can set your symbolic link from any directory. I set it from root for sake of simplicity. The main purpose is to establish a path without spaces or special characters.
Upvotes: 0
Reputation: 192487
Had this problem on MacOSX. The solution to add the mono bin directory to path solved it for me.
Specifically, "/Library/Frameworks/Mono.framework/Versions/Current/bin" needed to be on my path.
I did this:
export MONOPATH=/Library/Frameworks/Mono.framework/Versions/Current
export PATH=${PATH}:${MONOPATH}/bin
And afterwards, I was able to compile via:
gmcs /t:exe /debug+ -pkg:dotnet WinFormsHello.cs
(likewise for gtk# etc)
Upvotes: 0
Reputation: 1673
As an alternative to manually entering references, I found it easier to just install mono to a path with no spaces aka C:\devtools\mono and then adding the ... C:\devtools\mono\bin to your path. The command was then successful for me. As an aside I have had a similar problem before with using unix devtools on windows and this has worked there as well.
Upvotes: 1
Reputation: 46951
-pkg is broken on Windows; you will need to supply individual individual -r[eference]:
s. Please see this answer for details.
Upvotes: 1