How do you create exes from your c++ program? I want to be able to have a user use a gui to design a program and then create a program that they can run anywhere without my program. How can I do this?
How do you create exes from your c++ program? I want to be able to have a user use a gui to design a program and then create a program that they can run anywhere without my program. How can I do this?
You'll need to compile the C++ code with a compiler suitable for the system you want to run your executable on.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
If you want a user to customize only GUI you may be interested in the .Net programming based on using Windows Presentation Foundation and XAML
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
To be honest, if you really want the user to be able to build an executable from our environment you will be looking more into designing your own language which means you will have to be familiar with machine code. Alternatively you could make something similar to Java or VB whereby the user creates code that is executed by some sort of intermediary interpreter that you've designed. You could call it, C@ (pronounced "cat")
My program will generate the c++ code. How would you go about having your program compile and link it?
(this is not a question about compiling c++ code; im asking about making other programs with your program. what I want to do would be similar to GameMaker (except not nearly as complex))
You could call the compiler from your application, e.g.Obviously, if you generate multipel source files, etc, you would have to perform a more complex build. You could create a batch-file and then let that perform the compile, for example.Code:system("cl mycode.cpp");
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
im using windows, how would you link and compile?
"cl" is the Microsoft Visual Studio compiler. Given a single (but complete) source file, it will compile and link the source for you in one step. Of course, if the complete project is not in one file, you either have to give multiple source files to the compile command, or, if you have MANY files to compile, you'd have to compile one or a few files at a time, and link later.
You should really know how to do that if you are capable of writing an application that generates C++ code. How do you compile that?
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
in order to compile it, I would open it up in some ide (i use Dev-C++) and compile it.
i am a noob when it comes to the detailed stuff about compiling code. I want to package mingw with my program. I think I can figure it out, but help would be appreciated. I'll tell you if I do figure it out
Ok, soYou do realize that packaging gcc-mingw WITH your package is probably not a great idea. It's likely better that you put a link to where a suitable gcc-mingw can be found on your download page.Code:system("g++ -o myprog.exe myprog.cpp");
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Are there licensing issues or are you thinking it will be too large? Or both? :-)
Personally, I don't like software that asks me to download other software. At the very least, I'd provide an installer that downloads it for them, but I'd prefer to bundle everything they need.
> i am a noob when it comes to the detailed stuff about compiling code
But you're writing programs which write programs?
One of these statements doesn't make any sense. If you've got as far as you claim, figuring out how to compile should be the least of your problems.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Now we return to exactly why I suggested some sort of interpreted language such as an homage to Java or even more likely something more similar to Python.