PDA

View Full Version : C++ help please


crunkbbfe
07-19-2006, 12:22 AM
I have made multiple C++ programs that all use (C++ BuilderX) that compiler. My question is though how do you make it so that it is an exe file and does not require the compiler to run or just a exe file that makes it's own window and does not pop up in DOS mode

any help would be greatly appriciated ...Tyler

oracleguy
07-19-2006, 12:38 AM
Well if you compile it with the compiler it should generate a .exe you can use. C++ isn't an interpeted language, you shouldn't need the compiler installed for it to run.

However I haven't used the product you are using there, I assume it is also some sort of IDE (Like a development application and it compiles your program), so is there a menu choice to compile it for release or anything like that?

What files get generated when you run the compiler?

crunkbbfe
07-19-2006, 01:00 AM
there is an exe file when i compile it it says welcome.exe and below that has my files like file1.cpp

I'm just not sure how to take that .exe file and put use it somewhere else...

oracleguy
07-19-2006, 01:27 AM
Just copy the .exe some place else. If you want to run it, double click on it.

crunkbbfe
07-19-2006, 01:38 AM
Just copy the .exe some place else. If you want to run it, double click on it.

I've tried that but when i open the .exe file it opens a DOS page and then exits right away

here is a picture of what my C++ compiler looks like
i'm guessing it is similar to one u may be using it was store bought
http://crunkboii.byethost8.com/our/pix/tried.gif

Spookster
07-19-2006, 02:52 AM
I've tried that but when i open the .exe file it opens a DOS page and then exits right away

here is a picture of what my C++ compiler looks like
i'm guessing it is similar to one u may be using it was store bought
http://crunkboii.byethost8.com/our/pix/tried.gif

That probably means that the application you created is not a GUI application and it is only going to run in a command prompt. And when you double click on it it opens a command prompt and does whatever you programmed in it to do and then closes the command prompt. If you want to see the output of your application you either need to put some kind of pause in your program if you plan on double clicking on the exe file or just run the exe file from a command prompt that is already open as then it will not close after it is done running.

frog.frog
07-21-2006, 02:03 AM
Take your code and enter:

cout << endl;
system("PAUSE");

before return 0;. This will bring up a "press any key to continue" message which will let you view your program's output before closing.

Melon00
07-24-2006, 09:18 PM
I know some compilers do not support system("PAUSE");

If it doesn't work, you can use

getchar();

as well.