将.cpp文件编译成Program(exe)中的.exe? [英] Compile .cpp file to .exe inside of Program(exe)?

查看:171
本文介绍了将.cpp文件编译成Program(exe)中的.exe?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里是交易...

我想要一个程序(exe)将采取用户定义的设置和自定义用户在前面提到的程序(exe)里面。想要知道是否有像一个便携式gcc或某物?

I want to make a program (exe) that will take the user defined settings and make a custom (exe) file for the user inside of the previously mentioned program (exe). Wanted to know if there was like a portable gcc or something?

请尽可能详细,不太确定从哪里开始。

Please be as detailed as possible, not really sure where to start with this one.

推荐答案

编译器本身只是另一个程序,它读取一些输入(源代码)并写入一些输出(目标代码,太)。你可以使用 system()调用来执行编译器,例如使用gcc:

The compiler itself is just another program which reads some input (source code) and writes some output (object code, or executable if it runs the linker too). You can use something like the system() call to execute a compiler, for example with gcc:

system("g++ -o test test.cpp");

这将运行编译器( g ++ ) ,告诉它使用命名的源文件( test.cpp -o test c>)。

That will run the compiler (g++), telling it to create an output file with a specific name (-o test) using the named source file (test.cpp).

这篇关于将.cpp文件编译成Program(exe)中的.exe?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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