Originally Posted by fierydog
And at the end have a completely created c++ file that can be compiled and then have to include dev c++ and put a readme that gives instructions on compiling their own created game?
You aren't going to be able to generate executables from C++ code without compiling the code. You probably don't want to write your own C++ compiler in your program. And even if you did keep in mind that you'd have to distribute it with pretty much a full set of system headers and libs, depending on what you were compiling. So generating C++ files is not a bad idea.
If you go this way, you could place the requirement on the user that they have some sort of C++ compiler installed, such as GCC or the MS compiler. That's not a big requirement, as C++ compilers are readily available. Your program could then use that compiler to compile the generated code for them.
If it makes you feel any better, this is how pretty much every IDE (like Visual Studio) works... the compiler is a separate program, the IDE is just a nice convenient front-end for it.
What are you trying to do?
Alternatively you may wish to reconsider how your program works. Are you sure you want to generate C++ code and compile executables? Perhaps you could just store the required data in a data file and then you could have a single executable that could "run" whatever was in those data files.
For example, if you just wanted the user to be able to, say, print things to the console without knowing C++, you could store commands in a file, like:
Code:- PRINT here is a line
- PRINT here is another line
Copy Code Then you'd write a program that can interpret that data and do the right thing with it. And so you didn't need to generate actual C++ code and a binary for it. That's a really trivial example, though. |