creating executable programs

This topic is 4297 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

i'm confused about exe files. i thought the idea of an exe file was that it was self contained and you could run it anywhere. i put my exe in a folder with the dlls and tried running it on some different computers. it didnt work on any of them. most of them gave a windows "illegal operation" error message and wouldnt even run the file. one machine ran the file but it failed immediately and exited. how can i create a file that i know will work when i hand it in to my tutor? the program uses dev-c++, opengl and Cg.

Share on other sites
An .exe is not standalone unless it has no datafile or dll dependancies.

You need to have all the files that the program depends upon, and in the proper places. If you open a file for from a specific folder, it will bomb on a user's machine eg: "c:\code\myprogram\config.dat"

Also, it's possible you are just trying to do something that he other machine can't do. You didn't check that certain things were supported. You said CG, did you check the other machine to make sure it had all the caps for shaders and whatever you are using?

Using OpenGL extensions without making sure the user's machine can use them in your code is a sure way to get an AV in a hurry.

Share on other sites
Does your program use any other files(bitmaps,sounds,etc...)? You have to include those as well, along with the .dll's.

Edit: I'm always beaten, you guys are too fast.

Share on other sites
maybe there are some data files missing, or maybe the computers you've tried your program on dont have a video card that supports vertex programs?

Share on other sites
The executable is just the "core" element of the program as a whole, the main instructions. If there are any grapics you made (outside main code), textures, music, anything eles: they must be present and findable by the executable.

Also, the exe you made (with openGL) is dependent on openGL libraries, so the target machine must have openGL runtime installed.

There could always be other issues with this as well, such that the target machine doesn't support the video setting you used.

When you run the .exe in the build directory (when you compile)? If it doesn't, but it does run when you run it from the compiler, my first suggestion is to start copying the resources you used (such as graphic files, or other libraries) into that directory until it DOES run. Then try that whole folder on another machine for the next test step.

Edit: Yeah, you guys are fast

Share on other sites
Quote:
 Original post by Vampyre_DarkUsing OpenGL extensions without making sure the user's machine can use them in your code is a sure way to get an AV in a hurry.

yes this could be it. i have used quite a lot of relatively new openGL extensions. there are no image files or database files and i've tried running on machines with top level grpahics cards. forgive me for being stupid, but how do i go about fixing this? i dont really understand what openGL extensions are or how they work. is there s package i need to install on the target machine or something?

Share on other sites
Quote:
 Original post by judge dreadzyes this could be it. i have used quite a lot of relatively new openGL extensions. there are no image files or database files and i've tried running on machines with top level grpahics cards. forgive me for being stupid, but how do i go about fixing this? i dont really understand what openGL extensions are or how they work. is there s package i need to install on the target machine or something?

Windows is stuck @ GL 1.1, so an extensions are just normal functions from a later versions of OpenGL, or third party additions which are yet to be added into the core opengl library. They are supported via the video card drivers and the hardware if it has support for these features.

You need to query the driver for extension support and then react accordingly. GLEE can make this easier for you. http://elf-stone.com/ It's an easy to use extension library.

Share on other sites
so when it didnt work on the machine with the 6800 in it (i run a 6600 at home), could that just be that the gfx card drivers were out of date?

Share on other sites
so when it didnt work on the machine with the 6800 in it (i run a 6600 at home), could that just be that the gfx card drivers were out of date?

Share on other sites
that is possible, or you have some dll for the functionality you installed as part of an SDK which is lacking on the other machine.

Share on other sites
If you've check that it's not a missing data file problem, the easiest thing to do is make an error log. It doesn't even have to be errors, just write what you are doing in the program. For example:

Game StartedInitializing OpenGLCreating WindowLoading Texturesetc ect ect

Then you can see exactly where it is crashing on their machine. Or if it's a friend that lives near you, bring over the whole workspace and debug on there machine :D

Matt

Share on other sites
I just got my first compiler delivered yesterday from Amazon and the same thing happened to me. Then I realised that I still have to keep the images and other files in the same folder. When you compile it just mean that it can run independently without requiring the programming tool to interpret it. You can still run it on other computers as long as it still has all its files with it.

Share on other sites

This topic is 4297 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

• Forum Statistics

• Total Topics
628670
• Total Posts
2984152

• 13
• 10
• 10
• 9
• 9