简体   繁体   English

使用Emacs编译C#项目

[英]Compile C# project with Emacs

I use emacs to code and compile C# project. 我使用emacs编码和编译C#项目。

My project folder contain: 我的项目文件夹包含:

--\test
----Helloworld.cs
----make.bat

Then I open Helloworld.cs in a buffer and Mx compile, emacs will compile project for me. 然后我在缓冲区中打开Helloworld.cs并进行Mx编译,emacs将为我编译项目。

But if my project folder construction is like this: 但是,如果我的项目文件夹结构是这样的:

--\test
----\src
------Helloworld.cs
----make.bat

Then I open Helloworld.cs in a buffer and Mx compile, emacs cannot find make.bat. 然后我在缓冲区中打开Helloworld.cs并进行Mx编译,emacs无法找到make.bat。

I have to locate make.bat for "compile command" in minibuffer. 我必须在minibuffer中找到“编译命令”的make.bat。

Any help is welcome. 欢迎任何帮助。

emacs编译通常从源所在的同一目录运行。将Mx编译命令设置为../make.bat (或给它一个绝对路径),然后一切正常。

If ../make.bat works, then indeed it's a good option. 如果../make.bat有效,那么确实是一个不错的选择。 If not, you can use cd ../; ./make.bat 如果没有,可以使用cd ../; ./make.bat cd ../; ./make.bat as your compilation command instead. cd ../; ./make.bat作为您的编译命令。 You could even make Emacs look up the directory hierarchy for a make.bat file and add as many ../ as needed. 您甚至可以使Emacs查找make.bat文件的目录层次结构,并根据需要添加尽可能多的../

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM