Mono编译器无法正常工作 [英] Mono Compiler is not working
问题描述
我刚刚从其官方网站下载了mono编译器.我打开了cmd,然后按照单声道文档审阅中的指示(去了如何启动程序)转到单声道导演.
c->program files (X86)\Mono\bin
我创建了一个文件,并使用notepad ++编辑器编写了一个简单的hello world程序,然后将其另存为
Hello.cs
现在,当我尝试使用
执行它时mcs Hello.cs
错误提示
mcs is not recognized as internal or external command
我应该怎么做才能执行文件?
详细了解如何在Windows下设置PATH
并进一步了解 PATH
环境变量(另请参见此处).>
您可能需要键入mcs
批处理命令的完整路径.因此,如果您在C:program files\Mono\bin
中安装了 Mono ,则可能需要输入
"C:\program files\Mono\bin\mcs" hello.cs
(老实说,它是program files
,需要转义一个空格,所以我发现 this )
或者,使用一些cd
,pwd
,dir
命令在命令行上的文件树中导航(或通过在适当位置单击来启动初始终端).在Mono
中时,输入
bin\mcs hello.cs
当然hello.cs
应该放在适当的位置(或输入完整路径,例如bin\mcs c:\some\path\to\hello.cs
)
有趣的是,我从未使用过Windows ,我必须记住我在1980年代使用MSDOS的方式.我从1984年开始使用Unix,从1993年开始使用Linux.
您的问题与Mono完全无关,只是对Windows(或MSDOS)命令行工作方式的基本误解. PATH
也是最初在Unix上使用的(请参见 exec POSIX函数),他从 Multics 对其进行了加固.
I just downloaded mono compiler from its official website. I Opened cmd and went to mono director as told in mono document review (where it says how to start a program).
c->program files (X86)\Mono\bin
I have created a file and using notepad++ editor wrote a simple hello world program then saved it as
Hello.cs
Now when i try to execute it using
mcs Hello.cs
it give error saying
mcs is not recognized as internal or external command
what should i do to execute my file?
Read more about how to set PATH
under Windows and understand more the role of the PATH
environment variable (see also here).
You might need to type the entire path of your mcs
batch command. So if you installed Mono in C:program files\Mono\bin
you might need to type
"C:\program files\Mono\bin\mcs" hello.cs
(To be honest, it is program files
with a space that need to be escaped, so I found this)
Alternatively, use a few cd
, pwd
, dir
commands to navigate in your file tree on the command line (or start your initial terminal by clicking appropriately somewhere). When you are in Mono
then type
bin\mcs hello.cs
of course the hello.cs
should be at the appropriate place (or you type the entire path for it, e.g. bin\mcs c:\some\path\to\hello.cs
)
The funny thing is that I never used Windows, and I have to remember how I used MSDOS in the 1980s. I'm using Unix since 1984 and Linux since 1993.
Your question is completely unrelated to Mono, and is just a basic misunderstanding of how Windows (or MSDOS) command line works. PATH
is also, and originally, used on Unix (see some of exec POSIX functions), who steeled it from Multics.
这篇关于Mono编译器无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!