Welcome to Dream.In.Code
Become a C++ Expert!

Join 149,474 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,869 people online right now. Registration is fast and FREE... Join Now!




Make program runnable after finished without compiler/ide it was made

 
Reply to this topicStart new topic

Make program runnable after finished without compiler/ide it was made

sonar87
4 Feb, 2008 - 10:08 PM
Post #1

New D.I.C Head
*

Joined: 4 Feb, 2008
Posts: 3

I've read a lot of online tutorials and know enough to make some basic programs by now. I can save it and then open it back into the compiler and can run it from the compiler's run option. But how do I get it so I can run it with out going through the compiler? What if it was something I wanted to ditribute to other people? Is there a file type I can save it has or is there something I have to add to it that I don't know about? It's wrote, built/compiled, saved, what next?

This post has been edited by sonar87: 4 Feb, 2008 - 10:12 PM
User is offlineProfile CardPM
+Quote Post

MorphiusFaydal
RE: Make Program Runnable After Finished Without Compiler/ide It Was Made
4 Feb, 2008 - 10:17 PM
Post #2

D.I.C Lover
Group Icon

Joined: 12 May, 2005
Posts: 1,213



Thanked: 15 times
Expert In: Hardware, Networking

My Contributions
Locate the .exe and send that on. It's usually in the same directory as the source code, or in a subdirectory from there.
User is online!Profile CardPM
+Quote Post

sonar87
RE: Make Program Runnable After Finished Without Compiler/ide It Was Made
4 Feb, 2008 - 10:51 PM
Post #3

New D.I.C Head
*

Joined: 4 Feb, 2008
Posts: 3

knew I was absolutly clueless on this but I guess I am even more then I thought.

Kay, put in a different way, lets say I've just put in the code for a hello world program that they show everwhere, and there is absolutely nothing to the thing. Of course whatever I'm doing has more to it then that but for all puroses in this it probably may has well be the same thing. There is anything else that ended up being made I don't know about it or how to go about finding it if it is there. Next?

I'm probably missing something really simple here that I should know, but I've just read random tutorials, and I know what code does what, but nothing ever said a word on anything past that..
User is offlineProfile CardPM
+Quote Post

jjhaag
RE: Make Program Runnable After Finished Without Compiler/ide It Was Made
4 Feb, 2008 - 11:19 PM
Post #4

me editor am smartastic
Group Icon

Joined: 18 Sep, 2007
Posts: 1,789



Thanked: 2 times
Dream Kudos: 775
Expert In: C,C++

My Contributions
When you compile your code, an executable file is produced (the .exe spoken of above). This is what runs when you run your "code" - some IDEs have the capability of showing the output of console programs in a subwindow, but it's still that excecutable that's running.

So somewhere in your project directory (often in a debug subdir), you'll have a file called foo.exe file, where foo is (usually) the name of your project. This executable is a standalone program that you can run without the IDE, distribute, or do whatever you want with.




Although we often speak of "running code" or something along those lines, we're really talking about running the executable produced from said code. Code in C/C++ is nothing more than a plain text file(s), and until it's compiled and linked to produce an executable, it does nothing.
User is offlineProfile CardPM
+Quote Post

MorphiusFaydal
RE: Make Program Runnable After Finished Without Compiler/ide It Was Made
4 Feb, 2008 - 11:25 PM
Post #5

D.I.C Lover
Group Icon

Joined: 12 May, 2005
Posts: 1,213



Thanked: 15 times
Expert In: Hardware, Networking

My Contributions
You saved your source code to C:\MySource\Hello.cpp

The Executable is going to C:\MySource\Hello.exe

Just change that to wherever you saved your source to.
User is online!Profile CardPM
+Quote Post

sonar87
RE: Make Program Runnable After Finished Without Compiler/ide It Was Made
5 Feb, 2008 - 08:48 AM
Post #6

New D.I.C Head
*

Joined: 4 Feb, 2008
Posts: 3

Okay, I've downloaded a new compiler and I found the file. It turns out that the one I was useing before wasn't making a exe file, which I see now is due to the version I downloaded, not knowing the difference at the time. Thanks for the help.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 1/7/09 02:43PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month