通过另一个C程序编译C程序 [英] Compiling a C program through another C program

查看:71
本文介绍了通过另一个C程序编译C程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

as" spawnl"通过C代码执行exe。同样,我们怎么能通过另一个C程序(在Windows平台上)编译一个C程序?

解决方案

9月28日晚上8:29,Ajinkya< kaleajin ... @ gmail.comwrote:


As" spawnl" ;通过C代码执行exe。同样,我们怎样才能通过另一个C程序(在Windows平台上)编译一个C程序?



unix平台中的命令也会这样做...


9月28日,10日:29 pm,Ajinkya< kaleajin ... @ gmail.comwrote:


As" spawnl"通过C代码执行exe。同样,我们怎样才能通过另一个C程序(在Windows平台上)编译一个C程序?



spawnl不是标准的C函数,因此是OT,运行编译器的
的详细信息也是OT,但类似于 ; system(" cl

myprog.c");"假设

环境设置正确,可能会在某些平台上发挥作用。


Ajinkya写道:


9月28日晚上8:29,Ajinkya< kaleajin ... @ gmail.comwrote:


> ;作为spawnl通过C代码执行exe。同样,我们如何通过另一个C程序(在Windows平台上)编译C程序?



unix平台中的命令也会这样做...



您可以尝试:


system(" cc file.c");


当然你也可以为cc提供其他选项。


As "spawnl" executes an exe through C code., similarly how can we
compile a C program through another C program (on Windows platform) ?

解决方案

On Sep 28, 8:29 pm, Ajinkya <kaleajin...@gmail.comwrote:

As "spawnl" executes an exe through C code., similarly how can we
compile a C program through another C program (on Windows platform) ?

Command in unix platform will do too...


On Sep 28, 10:29 pm, Ajinkya <kaleajin...@gmail.comwrote:

As "spawnl" executes an exe through C code., similarly how can we
compile a C program through another C program (on Windows platform) ?


spawnl is not a standard C function and so is OT, and the details of
running compilers is also OT, but something like "system("cl
myprog.c");" might do the trick on some platforms, assuming the
environment is set up correctly.


Ajinkya wrote:

On Sep 28, 8:29 pm, Ajinkya <kaleajin...@gmail.comwrote:

>As "spawnl" executes an exe through C code., similarly how can we
compile a C program through another C program (on Windows platform) ?


Command in unix platform will do too...

You might try:

system("cc file.c");

Of course you can supply other options to cc too.


这篇关于通过另一个C程序编译C程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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