Jump to content

How to do C programming in Linux?


Recommended Posts

hi,

 

i have installed the Mandriva Linux Limited Edition 2005 on my pc but i am completely new to linux enviornment. Can any one please let me know as how i can start programming in C language using this Linux os? Please let me know as what i need to download in order to do so. Cheers.

 

[moved from Software by spinynorman]

Link to comment
Share on other sites

Do you want to program in a GUI, or are you just wanting to do within text files?

 

gcc is what exists to compile c once the programming has been done. To compile the c file, you would do:

 

gcc -o program program.c

 

the first "program" is the final compiled application, the latter "program.c" is the program code prior to compiling.

Link to comment
Share on other sites

hi guys,

 

thanks for the replies from both of you. actually i am totally new to linux but want to learn it as much as i can. yes i would like to have a program/gui (similar to that visual studio in terms of easieness of use i guess) using which i can program in c. it will be easier for me. can you suggest some please? thanks a lot.

Link to comment
Share on other sites

Neddie mentioned eclipse, and posted a link which contains some info on programming C under linux. I don't know of any others, I don't program :P

Link to comment
Share on other sites

Very nice web site, neddie. I've just bookmarked it. Thanks. :thumbs:
Very welcome!! mub-beer.gif

 

About python vs C++, they have quite different purposes - there are many things that you'd want to use C++ for but not python, and vice versa. There is no 'best for everything', but if you already have a grounding in C++ then you may find picking that up again easier than something completely different. Also consider perl, ruby, java, the list of possibilities is pretty long!

 

The original question was about C though, and yes you can use eclipse as your IDE. Or Kdevelop, but I've not tried that. And doubtless others too.

Link to comment
Share on other sites

hi neddie,

 

your introduction to linux on the geocities pages is very good and i have gone through it. but since i am an idiot trying my head around programming it seems that i need some more help from you. can you please tell me the steps involved in installing a gui that runs c.

 

as far as i understand first of all i need to download the eclipse CDT from the following page.

 

http://www.eclipse.org/cdt/

 

once i m on this page all i need to download is under the heading 'CDT Runtime Feature'

 

(includes editor, search, builders, launch, debug, gnu toolchain integrations for build/debug, user documentation)

 

and then after downloading the file for linux i should go down the page and download a file for linux under this heading 'CDT SDK Feature'

 

am i right or wrong please let me know. thanks.

Link to comment
Share on other sites

The easiest way:

 

urpmi eclipse-cdt

 

and that will install it for you. Much easier than you compiling from source. However, you might need to configure your easy-urpmi repositories, so click the link at the top of this page and add repositories for main, contrib, updates, plf-free and plf-nonfree.

Link to comment
Share on other sites

I don't know about that rpm, I haven't got it installed and I can't find it in my repositories (and yes I've got main, contrib, updates, plf-free and plf-nonfree)... but I didn't compile it from source either.

 

First of all you don't just need the cdt bit, you need eclipse as well. Once you've got eclipse, you can add the cdt component by following their instructions: (Note: I've still got eclipse 3.0 so I needed this version of CDT, if you've got a newer version of eclipse then use the appropriate link instead of this one)

 

CDT 2.0.0, 2.0.1, 2.0.2 and 2.1 (for use only with Eclipse Platform 3.0.X)

 

Use the following URL in a Site Bookmark in the update manager:

http://update.eclipse.org/tools/cdt/releases/new

 

To access the Update Manager, select Software Updates->Find and Install... from the Help menu. To access the update site listed above, select Search for New Features to Install and click on Next. Add a new remote site with the URL provided above, and then expand the site node to reveal the available downloads.

So I didn't download an extra file and save it, I just did everything from within eclipse with the Help -> Software Updates menu.

 

If you haven't got eclipse yet, you need to download that as well - it's quite a big download also from eclipse.org. And you also need a JRE or JDK to run the eclipse. Sounds complicated, but it's not. Get a JRE, get eclipse, and then from within eclipse get CDT. Done.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...