在Windows系统编译C使用Emacs [英] Compiling C with Emacs on windows system

查看:425
本文介绍了在Windows系统编译C使用Emacs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有从学校C语言编程经验一点点,但它是所有的Unix。我想要编译一些C使用Emacs,使用Emacs作为第二个IDE。

I have a little bit of C programming experience from school, but it was all Unix. I want to compile some C with Emacs, using Emacs as a second IDE.

什么是去这样做最简单的方法?我下载的Cygwin通过Emacs一个helloWorld.c的没有成功的编译。即便在打开cygwin命令提示符(外壳或任何其所谓的),它不承认gcc作为一个命令。

What is the easiest way to go about doing this? I downloaded Cygwin with no successful compile of a helloWorld.c in Emacs. Even opening the cygwin command prompt (shell or whatever its called), it doesn't recognize gcc as a command.

错误

'制作'不被识别为一个内部或外部命令,可操作的程序或批处理文件。

Error
'make' is not recognized as an internal or external command, operable program or batch file.

我需要一个编译器在Windows上运行,是免费的(或带有视觉工作室),并且可以使用Emacs使用。什么 M-X编译命令后键入到Emacs将是很好太了解。我看着M​​inGW的,但下载它是一件苦差事。

I need a compiler that works on Windows, is free (or comes with visual studio), and can be used with Emacs. What to type into Emacs after the M-x compile command would be nice to know too. I looked at MinGW, but downloading it is a chore.

我希望这个问题是有道理的。我经常迷失在开源世界中。

I hope the question makes sense. I often get lost in the open source world.

环保

Windows XP中,Visual Studio 2010中,Emacs的23.2.1,安装了Windows 7.1 SDK,Cygwin的

Environment
Windows XP, Visual Studio 2010, Emacs 23.2.1, Windows 7.1 SDK installed, Cygwin

推荐答案

我使用Visual Studio为使用Emacs作为编辑的编译器。

I use Visual Studio as a compiler with emacs as an editor.

刚刚安装Visual Studio C ++ 2010例preSS版。
那么我要做的就是写一个NMAKE Makefile文件,并从调用NMAKE
在Visual Studio命令提示符(从程序菜单访问)。
这对于较小的项目工作正常。

Just install Visual Studio C++ 2010 Express Edition. Then what I do is write an nmake Makefile and invoke nmake from the Visual Studio Command Prompt (accessible from the Programs menu). This works fine for smaller projects.

请参阅 http://msdn.microsoft.com/en-us/library /f35ctcxw.aspx
了解更多详情。

See http://msdn.microsoft.com/en-us/library/f35ctcxw.aspx for more details.

在大型项目中,您可以创建在Visual Studio中的解决方案和
只是使用emacs作为一个编辑器。您也可以从调用的MSBuild
命令提示符来构建解决方案。

For larger projects you can create a solution in Visual Studio and just use emacs as an editor. You can also invoke msbuild from the command prompt to build the solution.

此外,Visual Studio命令提示符只是调用了vcvars.bat(或类似的东西)
建立必要的环境。我想你也许可以修改Emacs的外壳,使其指向已运行启动该bat文件?CMD的一个实例

Also, the visual studio command prompt just invokes vcvars.bat (or something like it) to set up the necessary environment. I guess you might be able to modify the emacs shell to point to an instance of cmd that has run this bat file on startup?

这篇关于在Windows系统编译C使用Emacs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆