UbuntuThis forum is for the discussion of Ubuntu Linux.
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.
Which package do I need to install to get the standard library files for c programming?
Currently, not even
#include <stdio.h>
works. I thought the standard lib files automatically were added when installing the OS, but I guess I was wrong.
Originally posted by s_araj Yoou need to install the gcc compiler and the concerned libraries for C programs. You can search for them in the synaptic manager.
I've already installed the gcc compiler, but cannot find the concerned libraries. Any ideas?
When you installed gcc, the standard libraries should have been included as well. What commands are you running when you try to compile the program you have written?
(I used "gcc <filename>" just as a test. I know that the binary file is then named "a.out")
Okay, I think I fixed it, but I don't know how.
I tried "gcc-4.0" instead of just "gcc", and then it compiled. I seems the libraries were installed after all. But what I don't understand
is WHY this worked. "gcc" and "gcc-4.0" is exactly the same, as far as I can tell: running "gcc --version" and "gcc-4.0 --version" displays the
exact same information. Anyways, now even "gcc <filename>" works.
I'll try and build a larger project, and see what happens.
i am also trying to compile a simple helloworld program. i have all the gcc things in the synaptic pakage manager installed. i open a termainal window and went to the directory where the helloworld.c program is. when i use gcc helloworld.c i get the following:
error: stdio.h: No such file or directory. i get the same error when i use $gcc -o helloworld helloworld.c
i dont know if it does the same thing but i compile using gcc as (an example of a program named and saved as hello.c) "gcc hello.c -o hello" than run it using "./hello"
Originally posted by boxerboy i dont know if it does the same thing but i compile using gcc as (an example of a program named and saved as hello.c) "gcc hello.c -o hello" than run it using "./hello"
Originally posted by boxerboy ty reddazz i wasnt sure if the order things are in mattered i know some or most commands in termianl doesnt really matter.
Command line input are typically implemented as a switch-statement inside a while-loop, so the order of things does not matter.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.