Mono Development Environment on Win 7 64bit gmcs hello.cs -pkg: gtk-sharp-2.0 cannot find files

I downloaded Mono and installed it on Win 7 64bit

I went to this site to follow the instructions http://www.mono-project.com/Mono_Basics

I opened the mono command line and compiled and ran the console world hi.

then I tried to compile an example with a hello world window using

gmcs hello.cs -pkg:gtk-sharp-2.0 

and i get it

C:\Code\NoControl\Mono>gmcs hello.cs -pkg:gtk-sharp-2.0
error CS0006: Metadata file `C:/PROGRA\~2/MONO-2\~1.8/lib/mono/gtk-sharp-2.0/pango-sharp.dll' could not be found
error CS0006: Metadata file `C:/PROGRA\~2/MONO-2\~1.8/lib/mono/gtk-sharp-2.0/atk-sharp.dll' could not be found
error CS0006: Metadata file `C:/PROGRA\~2/MONO-2\~1.8/lib/mono/gtk-sharp-2.0/gdk-sharp.dll' could not be found
error CS0006: Metadata file `C:/PROGRA\~2/MONO-2\~1.8/lib/mono/gtk-sharp-2.0/gtk-sharp.dll' could not be found
error CS0006: Metadata file `C:/PROGRA\~2/MONO-2\~1.8/lib/mono/gtk-sharp-2.0/glib-sharp.dll' could not be found
Compilation failed: 5 error(s), 0 warnings

How to fix it?

It seems like the question here cannot compile hello.cs for gtk # using the mono command line , which it did not answer.

  • Does -pkg work on Windows?
  • Do I need to download something?
  • The shortened path mentions ~ 1.8 / if it says something like ~ 10.8 that my mono version is 2.10.8?
+3
source
3

, . Mono , . - "C:\SDK\Mono". , .

+9

, Windows 7, Mono "Program Files", C: (, MonoLinks.. NB ), Directory, , .

C:\MonoLinks>mklink /J Mono "C:\Program Files\Mono-2.10.8"

() Mono, Mono, , . C: (MonoLinks) , , C:.

, , PATH ) PATH, bin . " " " " PATH, C:\MonoLinks\Mono\bin (, PATH).

+6

-pkg, , Windows. , Program Files\Mono\bin PATH, gmcs Files\Mono\..., , . PROGRA~1\MONO\bin PATH Mono, PROGRA\~1/MONO/..., , ( ..) .

, 32- , , 64- , PROGRA~2 Program Files (x86).

, , - -r[eference] gmcs , pkg-config, . :

gmcs hello.cs -r:C:/PROGRA~2/MONO-2~1.8/lib/mono/gtk-sharp-2.0/gtk-sharp.dll
              -r:C:/PROGRA~2/MONO-2~1.8/lib/mono/gtk-sharp-2.0/gdk-sharp.dll
              ...

:

gmcs hello.cs -r:"C:\Program Files (x86)\Mono-2.10.8\lib\mono\..." -r:"..."

(.. )

If you are using NAnt, try uninstalling <pkg-references/>and adding:

<include name="C:\Program Files\Mono\lib\mono\gtk-sharp-2.0\gtk-sharp.dll" />
<include name="C:\Program Files\Mono\lib\mono\gtk-sharp-2.0\gdk-sharp.dll" />
...

under <references/>.

I apologize for using inconsistent and incomplete path names; This answer is for guidance, not copy-paste-solution.

+3
source

All Articles