Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
hey does any one know how to compile and run c,c++ programs in linux.i am confident that the gcc compiler is loaded into my system while i was installing linux.i wanna work out on c..some one help me out plz...
hey every one is being obscure in giving their replies. can you be more clear?i opened the console and
did
vi dhhh.cpp
then with in the vi editor,i typed the code and pressed ctrl+alt+z ,came out and then compiled
gcc -o dh.out dhhh.cpp
when i run the above command, i get a n error saying
Code:
root@dheeraj:~# gcc -o dh.out dhhh.cpp
gcc: dhhh.cpp: No such file or directory
gcc: no input files
root@dheeraj:~#
Originally posted by ksd hey every one is being obscure in giving their replies. can you be more clear?i opened the console and
did
vi dhhh.cpp
then with in the vi editor,i typed the code and pressed ctrl+alt+z ,came out and then compiled
gcc -o dh.out dhhh.cpp
when i run the above command, i get a n error saying
Code:
root@dheeraj:~# gcc -o dh.out dhhh.cpp
gcc: dhhh.cpp: No such file or directory
gcc: no input files
root@dheeraj:~#
now what do i do ??
what does ctrl-alt-z do in vi? i honestly don't have any idea. the way i learned how to save a file in vi is when you're done editing, press the esc key to get into command mode. then type ":" to enter the command, "wq". there's no quotes around the vi commands. then run the gcc command givent to you by mara.
when you want to run the compiled program use the command:
./dh.out
if you're using the command in the quote.
also, btw, get out of root and use a user account.
I don't have an idea of Ctrl+Alt+Z in Vi. I think that it would suspend the process. Ctrl+Z! So, save your file in vi by using the command :wq and then try compiling it.
My advice to newbies is that go for simple editors like pico, nano, jed intially or spend some time in reading the help for vi or emacs.
hey thanx praveenk for your reply.i have already implemented my first c++ program on my slack..
thanx all....btw i am beginning to feel vi is not a very good editor for newbies..so i will better try out ....
some other editors....emacs.....
Hey Emacs is more painful than Vi and also more powerful too. Emacs learning curve is more than that of Vi. My suggestion is that joe, jed, nano, pico are suitable for newbies.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.