Computer Hope

Software => Computer software => Topic started by: batchmaster60 on July 27, 2009, 06:46:51 PM

Title: How to convert .cpp to .exe
Post by: batchmaster60 on July 27, 2009, 06:46:51 PM
Hi I am wondering if there is a way to convert .cpp to .exe using c++ code,
if not can you give me a link to a program that can do it for me?

thanks in advance,

batchmaster60
Title: Re: How to convert .cpp to .exe
Post by: BC_Programmer on July 27, 2009, 06:55:02 PM
um... no


there is NOTHING that converts a CPP to an executable. not even a C++ compiler does that.
a compiler turns the CPP source into an object file, which is then linked with the C runtime as well as any other object files that comprise the program, into the final executable.

there is no way to do this directly through code unless you write a C++ compiler and a Linker.

you could, however, use the SYSTEM() command to invoke the compiler and linker for the file.
Title: Re: How to convert .cpp to .exe
Post by: batchmaster60 on July 27, 2009, 07:56:58 PM
could you give me an example?