Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Creating Executable By Code? (http://www.go4expert.com/forums/creating-executable-code-t691/)

TinyClone 6Apr2006 18:45

Creating Executable By Code?
 
How do you make an executable by a program? I want to have an option in my program to create an executable... how? thx in advance

sharmila 6Apr2006 19:13

Re: Creating Executable By Code?
 
I don't know whether it helps you or not.
There is a function called system() which is used to issue a shell command.
int system(const char *string);
string is the command.
int system("cc sample.c -o sample");
Then you will get an executable sample.

coderzone 6Apr2006 22:48

Re: Creating Executable By Code?
 
Quote:

Originally Posted by TinyClone
How do you make an executable by a program? I want to have an option in my program to create an executable... how? thx in advance

What compiler you are using to program the code.

TinyClone 7Apr2006 03:40

Re: Creating Executable By Code?
 
C++ / Visual Studio

coderzone 7Apr2006 05:20

Re: Creating Executable By Code?
 
Compiling the code will be creating the exe in the debug/Release folder in the workspace folder.

TinyClone 7Apr2006 12:27

Re: Creating Executable By Code?
 
This is what I mean:

You have a programm, let's say it makes maze games. A user can set different settings, and then he clicks File -> Create executable. So I want to make a programm that wil make programms :).

coderzone 7Apr2006 14:11

Re: Creating Executable By Code?
 
Thats a very complicated situations. You need to be having compiler to generate the executables but I guess your problem can be solved by a couple of ways.

1. Allow them saving a file of your custom extension say mz and when user double clicks it it opens using your application.
2. You save a compiled executable as a resource in the project of your VC and when user saves the data extract the binary resource to the harddisk and assign the settings accordingly into some predefined resources.

TinyClone 8Apr2006 04:23

Re: Creating Executable By Code?
 
well i was thinking about have a prefab executable that opens a file of custom exenstension, but i was wondering is it was possible to create my own custom made executable. (I seen it in some programs)

coderzone 8Apr2006 07:00

Re: Creating Executable By Code?
 
Can you give us an example of such a program.

TinyClone 8Apr2006 13:30

Re: Creating Executable By Code?
 
www.gamemaker.nl


All times are GMT +5.5. The time now is 14:03.