C在 Windows 上从 .C 文件创建 .exe

发布于 2024-10-27 15:17:44 字数 53 浏览 5 评论 0原文

我想知道是否可以在 Windows 上不使用任何编译器的情况下从 .C 文件创建 .EXE?

I would like to know if it is possible to create a .EXE from a .C file without using any compiler on Windows ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

独享拥抱 2024-11-03 15:17:44

您可以从另一个平台进行交叉编译,例如在另一个操作系统(例如 Linux 或 Mac OS X)上使用 MinGW,但最终你需要一个编译器某处

如果您实际上不需要 .EXE 本身,而只是想编译和运行一些 C 代码而无需安装编译器,例如用于教育/实验目的,那么有一些非常有用的网站例如 codepad.orgideone.com 为 C 和许多其他语言提供了此功能。

You can cross-compile from another platform, e.g. using MinGW on another OS such as Linux or Mac OS X, but ultimately you need a compiler somewhere.

If you don't actually need a .EXE per se, but just want to compile and run some C code without having to install a compiler, e.g. for educational/experimental purposes, then there are very useful sites such as codepad.org and ideone.com which provide this capability for C and a number of other languages.

我不会写诗 2024-11-03 15:17:44

如果你真的很疯狂,这是可能的。您需要十六进制编辑器和汇编知识。然后你可以玩“人类编译器”游戏,将 C 语言转换为汇编语言并将操作码放入十六进制编辑器中。要学习一些东西,它可能很有用,但在一般情况下,真正使用编译器!

If you are really crazy it is possible. You would need an hexadecimal editor and assembly knowledge. Then you could play the "human compiler" game, transforming C into assembly and putting the opcodes in the hex editor. To learn something it might be useful but in the general case really use a compiler!

你げ笑在眉眼 2024-11-03 15:17:44

您需要一个 C 编译器和链接器。你的朋友很困惑。

You need a C compiler and linker. Your friend is confused.

热鲨 2024-11-03 15:17:44

您也可以使用 Visual Studio Express。

从Visual Studio 2003开始,微软不再提供纯命令行编译器。该编译器现在随 IDE 一起提供。

You can use Visual Studio Express, too.

Since Visual Studio 2003, Microsoft doesn't provide pure command line compiler. The compiler is shipped with an IDE now.

神爱温柔 2024-11-03 15:17:44

正如笑话斯特所说,这只会改变它打开的方式,而不是转换文件本身,所以当您尝试打开它时,您只会收到错误。

with what jokester said, that will just change the way it opens, rather than converting the file itself, so when you try and open it, you will just get an error.

心的憧憬 2024-11-03 15:17:44

我对我的 C 代码使用 codeblocks 编译器,它会为您完成此操作,只需进入您刚刚创建的项目的项目文件夹,然后进入 bin 文件夹,然后进入 debug 文件夹,然后就可以看到那里有一个程序,这是你的程序,它是一个 .exe 文件

希望我可以帮助别人

I use the codeblocks compiler for my C code, and with that, it does it for you, just go into the project folder of the project you just made, then go into the bin folder, then go into the debug folder, and there is a program in there, which is your program and it is a .exe file

Hope i may have helped someone

做个少女永远怀春 2024-11-03 15:17:44

我想说,没有办法。根据定义,

编译器负责

  1. 检查代码中的错误
  2. 将无错误代码转换为目标文件

链接器负责将目标文件转换为可执行文件。对于 Windows,它是一个 .exe 文件。

There is no way, I would say. By definition

Compiler is responsible for

  1. Checking error in your code
  2. Convert the error free code into an object file

Linker is responsbile for converting the object file into an executable. In the case of Windows, it is a .exe file.

盛装女皇 2024-11-03 15:17:44

你只要使用 Turbo C++ 它就会自动生成一个 .exe 文件。你可以在“TurboC++\Disk\TurboC3\BIN”下找到它希望这有帮助

u just use Turbo C++ it will automatically make a .exe file. You can find it under "TurboC++\Disk\TurboC3\BIN" hope this hepled

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文