(Latest Revision: Fri Feb 23 22:12:19 PST 2001 ) compileHelp

compileHelp


Compilation And JOVE Stuff That Will Make Things Go Faster When You Are Writing And Debugging A Program.


Sample Commands for Compilation
g++ sourcename.cpp
        /* executable target will be named a.out. */
        
g++ -o targetname sourcename.cpp
        /* executable target will be named targetname. */

Compiling From Inside JOVE

In JOVE, do C-u, C-x, C-e, then do C-h four times to erase the default make command after the prompt at the bottom of the screen. (Remember that C-g will abort the current command if things get fouled up and you want to start over).

Next enter
 g++ sourcename.cpp 
That will run the compiler on the program called sourcename.cpp. The window will split. The compiler error messages, if any, will be listed in a small window. The cursor in the large window will move to the approximate location of the first error. This is very convenient when you are trying to locate and correct syntax errors.

You can jump the cursor back and forth between the two windows with C-x, o. (That's control-x, then letter o -- not control-o. This comes in handy once in a while if you have lots of errors and need to page forward through the list of errors.)

You can "un-split" the window by typing C-x, 1. (That's a control-x followed by a "one" -- not a control "one." After you execute that command, whichever sub-window contained the cursor will now be the only window.)

To compile the next time (during the same editing session in JOVE) just do C-x, C-e and hit return. JOVE "remembers" the compilation command.

On the desktop, you can have one terminal window with your JOVE session showing and another terminal window in which you place commands to execute your program. I recommend you do that when convenient.

Don't try to use the typical Unix suspend command of C-z to suspend JOVE. That is not working right. The terminal key mappings get all screwed up.

At times when it is not convenient or practical to work with separate terminal windows for editing and executing, you can type esc-s from JOVE to leave JOVE and enter a sub-shell where you will be able to enter Unix commands. To exit this shell and return to JOVE you enter the word "exit". This will put you back in JOVE with your cursor right in the place it occupied when you typed esc-s.


Incidentally, the arrow keys usually work for cursor control in JOVE. Under some conditions, they may not. In that case you can use the C-f, C-b, C-n, and C-p commands and other such JOVE commands that move the cursor.