How 2 program?
I have installed linux5 but i do not have any command line interface.
so how to do c-programming in it .do i have to install any software? |
Hi, and welcome
in order to start programming, you need a text editor and a compiler (usually gcc). You might also want to install any libraries you want to use in your programs. Also, giving the name of your distro could help. Serafean |
Quote:
What is "Linux5"? (Somewhere, there will be a brand name like Fedora, Ubuntu, Debian, etc. Somewhere in the menus, there is a terminal. Or, you can get a terminal by doing "ctrl-alt-F1" |
Quote:
I am able to edit the program using vi edit command but commands like gcc and ./a.out are not working so please tell me how do i install the compiler? |
Open up a terminal and type:
yum install gcc This is assuming you have either CentOS or RHEL 5. |
Another alternative would be to type "apt-get install gcc" at the prompt or go into synaptics from the Menu and load gcc from there.
The above is distro dependant of course |
Or better
Code:
yum groupinstall "Development Tools" Code:
apt-get install build-essential Code:
lsb_release -a |
Quote:
|
Quote:
|
Quote:
|
It was not clear from your first post that your system is running Red Hat Enterprise. You can update your profile to include your distribution, so that it is displayed under your nickname in all your posts.
To install software in RHEL you must have a valid subscription. Then you can connect to the Red Hat Network with your username and password and install software through the web. Otherwise use up2date from a terminal. See Code:
man up2date |
Quote:
|
You may have the library installed, but you probably still need to install the compiler itself. You can check by running "rpm -q gcc" to see if it is installed. If it's not, you'll need to use up2date to install it, as colucix suggests. Consult your Red Hat documentation and read "man up2date" for more information.
|
Thanks for ur previous reply
I have the library called libgcc installed in my list of software programs but when i try to compile c or c++ programs using gcc it gives me an error saying command gcc not found and what is the path to actually do and save i generally do it on home@localhost is my path right?please help.Thanks in advance. |
Quote:
As far as where to write programs, no, it doesn't matter (and why should it?) - it's up to you. Please use more punctuation. Your post is a bit difficult to read without it. |
Quote:
Then use "locate gcc" to find the path for gcc. As /X/Y/gcc Use the complete path to excute gcc as /X/Y/gcc sourcefile Good Luck |
Can you run these cmds and post the results:
rpm -qa |grep -i gcc uname -a cat /etc/issue |
All times are GMT -5. The time now is 03:34 PM. |