new to linux
wanted to know how to compile cpp prog in vi or emacs
editor
pls help:confused:
Printable View
new to linux
wanted to know how to compile cpp prog in vi or emacs
editor
pls help:confused:
I dont think you can but you should have a gcc compiler on Linux that will do it for you.
You are to compile it in console.
$ gcc prog.c -o prog
for C
$ g++ prog.c -o prog
for C++
or try manual pages
$man -a gcc
$man -a g++
vim can do that in its command line mode thingy, i dont know how my self but its in vims help file.
> vim can do that in its command line mode thingy, i dont know how my self but its in vims help file.
Do you mean `:w prog.c' then `:!gcc prog.c' in vim command?
yup, i forgot about the bang. now i have to see where output goes... this could come in handy, i normally use vim.Quote:
Do you mean `:w prog.c' then `:!gcc prog.c' in vim command?
In emacs: M-x compile
You could also setup a key to do it in your .emacs file. For example:
(global-set-key [f9] 'compile)
and if you have some errors on your code, M-` to go to the line...
you should also add something like that in your .emacs :
(global-set-key [f4] 'previous-error)
(global-set-key [f5] 'next-error)
oups, C-x M-`