Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: How to convert .cpp to .exe  (Read 5082 times)

0 Members and 1 Guest are viewing this topic.

batchmaster60

  • Guest
How to convert .cpp to .exe
« 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

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: How to convert .cpp to .exe
« Reply #1 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.
I was trying to dereference Null Pointers before it was cool.

batchmaster60

  • Guest
Re: How to convert .cpp to .exe
« Reply #2 on: July 27, 2009, 07:56:58 PM »
could you give me an example?