简体   繁体   English

没有IDE的Microsoft Windows 7上的本机C编程

[英]Native C Programming on Microsoft Windows 7 without an IDE

Is there any way to write, compile and run C programs from the Windows Command Prompt? 是否可以通过Windows命令提示符编写,编译和运行C程序? I mean just like what is possible from the Linux Terminal using the gcc compiler. 我的意思是就像使用gcc编译器从Linux Terminal可以实现的一样。

Specifically, I want to know how does Microsoft's "cl.exe" C compiler works. 具体来说,我想知道微软的“ cl.exe” C编译器如何工作。 How do I install it? 如何安装? Is it possible to simply write a C Program in a text editor like notepad, then compile it using cl.exe from Command Prompt and run it from there? 是否可以简单地在文本编辑器(如记事本)中编写C程序,然后使用命令提示符中的cl.exe对其进行编译并从那里运行它?

Note: I do not want any other kind of C programming solutions on Windows, like using 3rd party compilers like Turbo-C, DevC++, etc, or using Unix emulators like MingGW, etc, or even IDE solutions like Visual Studio, Eclipse, etc. I already know about these. 注意:我不希望Windows上有任何其他类型的C编程解决方案,例如使用Turbo-C,DevC ++等第三方编译器,或者使用MingGW等Unix模拟器,甚至不使用Visual Studio,Eclipse等IDE解决方案。我已经知道这些了。

What I want is to use the native Windows platform for console application programming using Microsoft's own cl.exe compiler and standard Windows libraries. 我想要的是使用本机Windows平台通过Microsoft自己的cl.exe编译器和标准Windows库进行控制台应用程序编程。 Is it possible? 可能吗?

Apologies if I sound too complicated :) 抱歉,如果我听起来太复杂了:)

This explains how to use the cl.exe command line options. 说明了如何使用cl.exe命令行选项。 You may need to set your PATH variable correctly for this to work. 您可能需要正确设置PATH变量才能起作用。

You ask and answer your own question - there is nothing to it more than downloading the SDK, and using the developer command line to compile a file ( cl hello.c ). 您可以提出并回答自己的问题-除了下载SDK并使用开发人员命令行编译文件( cl hello.c )外,没有什么其他的。 By using the shortcut to the developer command line, your PATH and other environment variables are correctly set and you're ready to start compiling immediately. 通过使用开发人员命令行的快捷方式,可以正确设置PATH和其他环境变量,并准备立即开始编译。

This is the full cl documentation . 这是完整的cl文档

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

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