LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How 2 program? (https://www.linuxquestions.org/questions/linux-newbie-8/how-2-program-660115/)

zainab 08-03-2008 10:28 AM

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?

serafean 08-03-2008 10:35 AM

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

pixellany 08-03-2008 11:06 AM

Quote:

Originally Posted by zainab (Post 3235175)
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?

Welcome to LQ!!

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"

zainab 08-06-2008 10:37 AM

Quote:

Originally Posted by serafean (Post 3235183)
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

I have the text editor but how do i install the compiler ?
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?

kenoshi 08-06-2008 10:51 AM

Open up a terminal and type:

yum install gcc

This is assuming you have either CentOS or RHEL 5.

john test 08-06-2008 10:55 AM

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

colucix 08-06-2008 10:57 AM

Or better
Code:

yum groupinstall "Development Tools"
or
Code:

apt-get install build-essential
to install all the development utilities like make, ld and so on. You can also use the graphical package management tool of your system. For example System --> Administration --> Add/Remove software on Fedora, or Yast Package management on OpenSUsE, or Synaptic on Ubuntu and so on. Which is your distribution, anyway? Try
Code:

lsb_release -a
to find out.

zainab 08-09-2008 04:30 AM

Quote:

Originally Posted by colucix (Post 3238834)
Or better
Code:

yum groupinstall "Development Tools"
or
Code:

apt-get install build-essential
to install all the development utilities like make, ld and so on. You can also use the graphical package management tool of your system. For example System --> Administration --> Add/Remove software on Fedora, or Yast Package management on OpenSUsE, or Synaptic on Ubuntu and so on. Which is your distribution, anyway? Try
Code:

lsb_release -a
to find out.

Thanks so much for your suggestion but actuall neither of it is working and its asking me to connect to the RHN terminal ... so actually how to connect to the RHN terminal and my distributor is RedHat.Thanks in advance.

zainab 08-09-2008 04:31 AM

Quote:

Originally Posted by kenoshi (Post 3238827)
Open up a terminal and type:

yum install gcc

This is assuming you have either CentOS or RHEL 5.

Thanks so much for your suggestion but actually it is not working and its asking me to connect to the RHN terminal ... so actually how to connect to the RHN terminal and my distributor is RedHat.Thanks in advance.

zainab 08-09-2008 04:33 AM

Quote:

Originally Posted by john test (Post 3238832)
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

Thanks so much for your suggestion but actually it is not working and i don't have anything called synaptics its asking me to connect to the RHN terminal ... so actually how to connect to the RHN terminal and my distributor is RedHat.Thanks in advance.

colucix 08-09-2008 04:55 AM

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
to see the syntax to install a group of package, that one providing all the essential tool to develop applications. Check also the documentation in the Red Hat Network site, to see the various alternatives to install software on your system. Good luck! :)

zainab 08-31-2008 01:12 PM

Quote:

Originally Posted by colucix (Post 3241637)
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
to see the syntax to install a group of package, that one providing all the essential tool to develop applications. Check also the documentation in the Red Hat Network site, to see the various alternatives to install software on your system. Good luck! :)

I already have the library called libgcc in my list of installed software but when i try to compile the programs and type gcc on the command prompt it gives an error saying gcc command not found so what should i do?please help

btmiller 08-31-2008 01:15 PM

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.

zainab 08-31-2008 01:24 PM

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.

Nylex 08-31-2008 01:27 PM

Quote:

Originally Posted by zainab (Post 3265400)
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.

You've been told several times that you need the compiler itself installed. Please read the posts above to find out how to do that.

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.

john test 09-01-2008 07:54 AM

Quote:

Originally Posted by zainab (Post 3265400)
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.

Use a text editor to create the Sourcefile as "nano sourcefile"

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

chrism01 09-01-2008 07:37 PM

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.