Reputation: 487
I'm having a complete program, but now, I want it to be able to be updated. So I would like to change the "code" in the executable by the new code without having to recompile it.
Is it possible? If yes, how can I do, I coding in C++ in Qt Creator.
Thanks for any advise/clue
Upvotes: 0
Views: 3798
Reputation: 487
I did exactly what Jon told me : simply replace the old exe by the new one
Upvotes: 1
Reputation: 167
While you can't technically do this in C++ without recompiling, if you don't want to rewrite in another programming language, you could write a small helper program that (while the original program is not running) recompiles the first program.
If you really wanted to do this (it's not hard at all) I'd look into GNU g++. If you're using Windows, you'll probably want MinGW (which I believe comes with g++ installed). Both are free/open source and fall under the GNU GPL (something you need to look at if you are planning on selling your program. However, you're free to give it away)
Basically you could run your program, call another program before closing, and have that program act as a script to call g++ to re-compile your code. I've done this before, but for faster debugging rather than actually releasing a program that works that way.
Upvotes: 0
Reputation: 2648
Not sure this answers your needs, but did you look into the ClickOnce platform? Although the code still gets recompiled on your server the client executable gets updated via ClickOnce.
Upvotes: -1
Reputation: 190986
C++ can't do this. With QT, you could have a javascript implementation of the code you want changed and update that.
Upvotes: 3