question about compiling programs in Xubuntu

Asked by Spapis

Hey guys
I have just installed Xubuntu and I can't compile a program due to the fact that the compiler can't find the stdio, stdlib etc..

please help...

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Clóvis Fabrício
Solved:
Last query:
Last reply:
Revision history for this message
Jim Qode (jimqode) said :
#1

sudo apt-get install build-essential

Revision history for this message
Spapis (pspapis) said :
#2

Jim I am a rookie so provide me please more ifo

Revision history for this message
Spapis (pspapis) said :
#3

Exactly, when i am trying to compile the famous Hello World program that i have named hw.c i take the message:

hw.c:1:19: error stdio.h: No such file or directory
hw.c:In function 'main':
hw.c:5: warning: incompatible implicit declaration of built-in function 'printf'

the program is correct, i can tell it for sure

Revision history for this message
Best Clóvis Fabrício (nosklo) said :
#4

You must open a terminal
Then in the terminal you type the following command:

sudo aptitude install build-essential

It will ask for your system password, provide it.

After that, type the program and try to compile it.

If it doesn't work, please past program code.

Or try this one:

#include <stdio.h>

int main() {
        printf("Hello World\n");
        return 0;
}

Revision history for this message
Spapis (pspapis) said :
#5

Thanks ClovisFabricio, that solved my question.

Revision history for this message
Spapis (pspapis) said :
#6

thanks ClovisFabricio you saved me!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I ought to you big favor......