cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Calling up code to be compiled automatic
Calling up code to be compiled automatically
Dec 10, 2011 at 11:57pm UTC
Mats
(1398)
So I have a program and it writes a new (modified) copy of itself to a file.cpp. How can I get the program to call up my compiler to compile this new source file?
Dec 11, 2011 at 9:27pm UTC
mmay
(55)
Depends which compiler and which platform... for MinGW GNU C++ under Windows, something like:
system(
"g++ file.cpp -o file2.exe"
);
perhaps? (usually you won't be able to write to an executable image while it's running, thus the use of a different filename there).
Last edited on
Dec 11, 2011 at 9:28pm UTC
Topic archived. No new replies allowed.