8/13/2008

Cannot Compile C Programs in Initial Ubuntu

Ubuntu is very useful and one of Linux distribution I recommend for Linux beginner.

However, we can't compile C programs by gcc even "Hello, world!" because of not installed C developer's libraries. I think that it is a hole many beginners developing in Ubuntu fall into.

Therefore, I wrote how to install C developer's libraries "libc-dev" and editor "Emacs" in Ubuntu.

Debian Packages

Because Debian packages is available in Ubuntu, We can install many software by "apt-get" command. However, Ubuntu doesn't the administrator's account "root" from consideration on security. Therefore, we use "sudo" command instead of "su" command in order to run commands need administrative privilege. That is, we generally use "sudo" command to install a package. package means the package's name you install.

$ sudo apt-get install package

Developer's library in C: libc6-dev

Run the following command in a terminal(shell). Answer "y" to questions during install.

$ sudo apt-get install libc6-dev

Editor: emacs

$ sudo apt-get install emacs

Original Text(Japanese)

1 comment:

cristybinny@gmail.com said...

i had problm in compilng c.. But in terminal wht must v do actually, am a begnr n didn't understand d step u mentioned above that in terminal. That is hw to run d command libc6-dev (, n abut d package name)..
Thanking u for u'r help in advance...