Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Converting A C File Into .exe (http://www.go4expert.com/forums/converting-c-file-exe-t18525/)

fob500 13Jul2009 17:39

Converting A C File Into .exe
 
Hi could any one tell how to convert a c file into an executable file ?
Also I have designed a simple screen saver in C ..How can I convert it into a setup program(to install on a windows based computer).Like any other setup program.

shabbir 13Jul2009 17:53

Re: Converting A C File Into .exe
 
Compiling the source code would generate an executable file in Windows. Which compiler you are using?

fob500 13Jul2009 18:06

Re: Converting A C File Into .exe
 
Quote:

Originally Posted by shabbir (Post 52426)
Compiling the source code would generate an executable file in Windows. Which compiler you are using?

Well doesn''t compiling create an object file ?? I'm using the GCC compiler on a linux platform.

shabbir 13Jul2009 19:20

Re: Converting A C File Into .exe
 
Quote:

Originally Posted by fob500 (Post 52428)
Well doesn''t compiling create an object file ?? I'm using the GCC compiler on a linux platform.

Ohh! then there is nothing called an exe file in Linux BTW

fob500 13Jul2009 22:17

Re: Converting A C File Into .exe
 
Quote:

Originally Posted by shabbir (Post 52434)
Ohh! then there is nothing called an exe file in Linux BTW

Yes that is true but it is irrelevant to the question I asked.My friend if you read my first post again I have clearly mentioned
that
---------------------------------------------------------------------------------------------------
How can I convert it into a setup program(to install on a windows based computer).Like any other setup program.
-----------------------------------------------------------------------------------------------------
I merely replied to the question you asked that 'what compiler I was using' I never said that I am trying to have an exe file for linux.

Anyway let me re phrase my question I have a C program (maybe a screen saver) and I want to make a setup for it so that it can be distributed and installed ON A WINDOWS BOX.Can any one tell me how to go about it.
Also I have programmed in C on windows long time back on something called 'Turbo C' .Not sure if that was the compiler name that you expected. Does it also produce an exe file when you compile a c program.Thanks

xpi0t0s 14Jul2009 00:51

Re: Converting A C File Into .exe
 
A compiler creates an object file, and a linker creates an executable.
The Visual Studio compilers and SDK can be downloaded for free from the Microsoft web site (Visual Studio IDE itself is a premium product that you have to pay for)
If you don't want that then there are free compilers for Windows, MinGW being one.

I don't know anything about setup programs but if you search MSDN for "msi" (the install set extension) that should take you to some relevant pages.

Also I don't know if there are any cross compilers that run on Linux to generate programs that run on Windows, cos that's what you're asking for. Probably best to develop Windows programs on a Windows machine.

shabbir 14Jul2009 09:22

Re: Converting A C File Into .exe
 
You are asking how to goto step2 when you have a big issue with step1.

If you have an exe I can tell you how to make an installer but unless you have an exe it would be of no help.

fob500 14Jul2009 10:28

Re: Converting A C File Into .exe
 
Quote:

Originally Posted by shabbir (Post 52461)
You are asking how to goto step2 when you have a big issue with step1.

If you have an exe I can tell you how to make an installer but unless you have an exe it would be of no help.

Ok so the problem now is that I have a running program on windows box(:happy: that is not the problem actually) so how do I go about getting an .exe file.When I compile it on windows the output file is it an object or exe file ?

fob500 14Jul2009 10:32

Re: Converting A C File Into .exe
 
While we are at it could any one tell ,When we compile a C program on windows and on Linux is there any difference between the output files produced after compilation ?

shabbir 14Jul2009 10:35

Re: Converting A C File Into .exe
 
Quote:

Originally Posted by fob500 (Post 52466)
While we are at it could any one tell ,When we compile a C program on windows and on Linux is there any difference between the output files produced after compilation ?

The output files produced are such that they work on the compiled system. By compiling I meant complete compile / linking and producing output files.


All times are GMT +5.5. The time now is 13:43.