Creating Executable By Code?

Go4Expert Member
6Apr2006,18:45   #1
TinyClone's Avatar
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
Contributor
6Apr2006,19:13   #2
sharmila's Avatar
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.
Team Leader
6Apr2006,22:48   #3
coderzone's Avatar
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.
Go4Expert Member
7Apr2006,03:40   #4
TinyClone's Avatar
C++ / Visual Studio
Team Leader
7Apr2006,05:20   #5
coderzone's Avatar
Compiling the code will be creating the exe in the debug/Release folder in the workspace folder.
Go4Expert Member
7Apr2006,12:27   #6
TinyClone's Avatar
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 .
Team Leader
7Apr2006,14:11   #7
coderzone's Avatar
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.
Go4Expert Member
8Apr2006,04:23   #8
TinyClone's Avatar
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)
Team Leader
8Apr2006,07:00   #9
coderzone's Avatar
Can you give us an example of such a program.
Go4Expert Member
8Apr2006,13:30   #10
TinyClone's Avatar
www.gamemaker.nl