Making an executable file from a program

S

Sowrabh

Can any one suggest how to make a .exe file from any (fully compiled
error free)executable program?

Thanks in advance
 
T

Tomás Ó hÉilidhe

Can any one suggest how to make a .exe file from any (fully compiled
error free)executable program?

Thanks in advance


You use a C compiler to turn source code into an EXE file. I'm gonna
take a guess that you're using either a Linux machine, a Solaris
machine, a Microsoft Windows machine, or an Apple Mac machine.

On all of these platforms, you can get the C compiler called "GCC". If
you're using Linux or Solaris, then GCC should already be installed on
your computer. If you're using Microsoft Windows or an Apple Mac, you
will have to download GCC.

Once you have GCC installed on your computer, you can do the following
to actually compile a program into an EXE file. First of all, create a
file called "main.c" and edit it as follows:

---Begin main.c---
#include <stdio.h>

int main(void)
{
puts("I'm a compiled program!");
return 0;
}

---End main.c---

Next, open up a terminal (or in Microsoft Windows, a "command
prompt"), and type the following:

gcc -o prog.exe main.c

This will create an EXE file called "prog.exe" from the source code
file "main.c".

(You can get C compilers for stuff other than PC's, you can get them
for tiny little microchips the size of your fingernail)
 
F

Flash Gordon

Richard Heathfield wrote, On 16/12/08 05:28:
Sowrabh said:


That's like asking how to make soup from soup. A properly
constructed .exe file (on a Windows or MS-DOS or CP/M machine) /is/
an executable program.

No, it's more like asking how to make chicken soup the same as mum
always made from any food someone might give you, including one sugar
mouse and nothing else.

Not all executable programs can run on Windows, DOS or CP/M. Not all
executable programs on those systems are .exe programs (that is a
specific format and not the same as .com).

To the OP, it is not, in general, possible. It is also not a C problem,
since once the program is compiled it does not matter what language was
used. You really need to think and ask about what your real problem is,
and ask in a more appropriate group.
 
B

Bartc

You use a C compiler to turn source code into an EXE file. I'm gonna
take a guess that you're using either a Linux machine, a Solaris
machine, a Microsoft Windows machine, or an Apple Mac machine.

The OP might be asking how to convert an existing executable from a
non-Windows machine into a Windows .EXE program.

I don't think that's possible without using some sort of non-trivial
emulation or translation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top