( Latest Revision:
Sat Apr 13 22:10 PDT 2013
)
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.
You can use the typical Unix suspend command of C-z to suspend JOVE,
and type fg to return to JOVE.
Incidentally, the arrow keys may or may not work for cursor control in JOVE.
If the arrow keys don't work, you can use the C-f, C-b, C-n, and
C-p commands and other such JOVE commands that move the cursor.