| Thread Closed |
having trouble running C++ compiler |
Share Thread |
| Jun1-08, 10:52 AM | #1 |
|
|
having trouble running C++ compiler
The type of compiler I am using is Dev-C++. I have no problem compiling my code and my compiler has generated no errors. However , when I try to run my code, The command prompt for like a nano-second and disappears and I have no idea of how to retreive it .
|
| Jun1-08, 11:12 AM | #2 |
|
|
It sounds like you either need to run your program from a persistent command prompt, or change your program so that it doesn't finish immediately upon printing the output you want to see.
|
| Jun1-08, 11:15 AM | #3 |
|
|
It would help if you could post some code example which do not work for you, otherwise it is not very easy to help you.
|
| Jun1-08, 11:33 AM | #4 |
|
|
having trouble running C++ compiler
Check if there are any spaces in the names of any of the folders/subfolders/files that you are using for the compiler and name of your program file...
e.g. should be C:\\MyDocuments\compiler\program.exe NOT C:\\My Documents\the compiler\test program.exe (I also use Dev-C++, if I have any spaces in the names, it does exactly what you say yours does) |
| Jun1-08, 11:43 AM | #5 |
|
|
With most newer IDE environments, when you execute a terminal program in windows, as soon as the program is terminated, the terminal window will close. There are ways to alter this behavior, but usually the best course of action is to open a persistent terminal window, and execute your program from there.
For example, go to "RUN" and type: cmd. Then navigate to the directory where the program is compiled, for instance cd C:\users\administrator\documents\debug. Then, you simply execute the program by invoking its name, for example, C:\helloworld.exe. Your other option is to put some kind of pause statement at the end of your program, to allow you to view the output. For instance: int End1; cin >> End1; return 0; Then, the program will wait for you to enter an integer, giving you time to view the programs output before the terminal window is closed. |
| Jun1-08, 12:20 PM | #6 |
|
|
|
| Thread Closed |
Similar Threads for: having trouble running C++ compiler
|
||||
| Thread | Forum | Replies | ||
| SML compiler? | Programming & Comp Sci | 1 | ||
| Does anyone here use the compiler for PIC processors from CCS? | Electrical Engineering | 1 | ||
| icc compiler | Programming & Comp Sci | 7 | ||
| Compiler | Computing & Technology | 1 | ||
| Compiler | Computing & Technology | 7 | ||