how do you make an executeable program??

Started by
8 comments, last by BlueBan007 14 years, 11 months ago
I would really like to know how to move my program from my dev++ compiler to a usb drive and be able to show it to other people on other computers... can anyone help me out?
Advertisement
First of all i would like to suggest you use something other than DevC++. A lot of people here will tell you why not to use it but basically it is old and outdated. There are much better IDEs out there, e.g Code::Blocks.
Now, if you want to run your program by itself, without the IDE, just look in the project folder and you will find the .exe file (i forget where exactly, just have a look). Since you haven't described your question in more detail, i can't really provide much more of an answer. For example, do you have other files that your program needs and you want to move all those files with the program? Does it have any DLL dependencies? Does the program use the Windows registry or require an installer? But, if it's just a simple program then my first answer will probably suffice.
[Window Detective] - Windows UI spy utility for programmers
I've never used Dev++, but I assume that it works like most other IDEs.
When you tell it to build or compile the program, it should create an .EXE file for you which you can copy to your USB drive and let other people run it.
Depending on what kind of App you're building, you may (or may not) need to copy some .DLL files with it.
-----OpenEndedAdventure.com - The Adventure that Anyone Can Edit.
Just to add on; most of the time there will be a Release mode you can compile to and this will get you the exe you need.
the number one reason why programs wont run is there is missing files that the app depends on. These files differ from run-time files to configure files even simple missing resources like picture and or icons can make apps bug out. to find out what is need to be shipped with the app use some type program like dependacy walker. if you know your code well enough you can spot most dependacies.
Bring more Pain
I am using SDL and I understand that I think I need to include the dll with it, I am also using quickcg, and suppose I use those to, but I cant find the .exe! D:

and I see no release mode...or anything like that
Hey BlueBan007,



I use the Standalone DevC++ (version 4.9.9.2) with SDL myself. You can use DevC++ on a USB device by downloading DevC++ portable which is exactly the same as DevC++ but made to run of portable storage devices.
You can get it here http://www.softpedia.com/get/PORTABLE-SOFTWARE/Programming/Windows-Portable-Applications-Dev-C-Portable.shtml


DevC++ will create a .exe file of your project in the folder your project is located as default. You can change that in the project options under "Build Options". I have found that on other versions of DevC++ it can prompt you to "where you want to save your .exe file". However I assume you have not encountered this. Apparently DevC++ does not work on Windows Vista. So If you are using Windows XP or Linux, try out what follows.

After clicking compile, It should show some sort of message that it compiled correctly. With my version I get a small tab down the bottom of the screen open up and report the details of the compile. If DevC++ does not compile correctly it wont make any .exe for sure. On the other hand, if it did compile correctly then you need to run the program before DevC++ will create the exe. When you just compile, it will only be in your computers memory. I believe F9 is a shortcut to "Compile and Run", if that helps. :P


DevC++ might not be the problem. Your actual program/code could be incorrect. For example, if SDL is not being linked to correctly or is corrupt (hey, it could happen) then it could cause DevC++ to react pretty strangely. This is the least likely cause and I need not go on about it. Just check through your program and make sure it works.

Finally, if you manage to get an .exe file. If you want to run your program off a USB or on another computer, you will also need to include in your folder (containing the .exe) all the DLL files for SDL and whatever other libraries or other things your program links to. You don't have to include all the (.c, .h, etc) files.


Thats just my contribution. If you still cant get anything to work, please reply. Just following are some useful links.

http://www.bloodshed.net/devcpp.html (DevC++ home)
http://www.bloodshed.net/faq.html (DevC++ FAQ and problems)
http://www.libsdl.org/download-1.2.php (last stable SDL release)
http://computerprogramming.suite101.com/article.cfm/get_started_with_bloodshed_dev_c__ (a useful guide to getting started with DevC++)




PS: Tell me if it works! :D
~ LordCube
Wow! Thanks! great answer!
that was refreshing, I was beginning to think no one wanted to share knowledge lol

works great!

ps. I am using vista, and dev++, and it works fine so idk
Quote:Original post by BlueBan007
that was refreshing, I was beginning to think no one wanted to share knowledge lol

Well to be fair, you didn't explain what you wanted very well so it's hard for us to tell you exactly what you want to hear. You say you can't find the exe but you didn't say if or where you have looked.
[Window Detective] - Windows UI spy utility for programmers
true, true (:

/thread

This topic is closed to new replies.

Advertisement