Creating an executable

Started by
10 comments, last by pulpfist 16 years, 10 months ago
Hey guys, im a degree student in games development, Had a bit of trouble this year when i was handing in one of my coding assignments. I could not get the game to run off the disk. Usually when i want to look at one of my games i can just go to debug folder and click the .exe file there. However, when i put all the files (.sln, .obj, .cpp etc....) files on the disk the game wouldnt run. Had to have my lecturer take the code and compile it himself. Can anyone shed any light on how to create an executable without having to compile again and again on different machines P.S. Im using Visual Studio 2005.
---Terence Burns---
Advertisement
Are you using the express edition of visual studio 2005?
--------------------Enigmatic Coding
no, full version
---Terence Burns---
Do you have all of your resources with the exe (that is, if you have resources)?
--------------------Enigmatic Coding
Quote:Original post by anothrguitarist
Do you have all of your resources with the exe (that is, if you have resources)?


yea, i have all the resources in a folder thats linked to the file, when i added them to the disk i had the media folder in this folder with the executable in the debug folder

Folder Image
---Terence Burns---
I wish I could help, but I don't know the answer. I don't want to lead you in the wrong direction either, so I'll leave it up to the more able members help you.

Good luck.
--------------------Enigmatic Coding
Quote:Original post by anothrguitarist
I wish I could help, but I don't know the answer. I don't want to lead you in the wrong direction either, so I'll leave it up to the more able members help you.

Good luck.


Thanks anyway mate, ;-)
---Terence Burns---
.cpp and .h files are text files that contain your code. They do nothing for the final .exe, and you don't want to be distributing them (unless you want to, so people can modidy your code).

.obj are object code files. An in-between format from cpp to .exe. The linker takes all you object files, and links them into 1 executable file. You do not distribute these with your final .exe either.

Usually, under default settings, MSVC will put your debug .exe in a debug subfolder, and a release .exe in the release subfolder.

I can see you have a debug folder. Your debug build .exe should be in there. You don't actually want to be distributing debug builds either (and I think there might be something in the EULA against it, but don't quote me on that!).

You want to make a release config, and compile a release mode executable. Distribute this, along with any other external files you need to load, and make sure the folder structure stays the same on your distribution media.
The cpp and h files were just included for my lecturer to mark.

Thanks for the info on the release .exe tho mate, thats the idea i kinda thought originally anyway
---Terence Burns---
To run an .exe created with Visual C++ in a system that doesn't have VC installed you need to also redistribute VC redistributable. That will probably solve the problem.

This topic is closed to new replies.

Advertisement