View Full Version : Cannot compile any c program with gcc

November 2nd, 2007, 03:00 AM
Hey guys.

I am a bit new to ubuntu, and i tried to compiled this little program last night to make sure everything is working on my system. I run 7.10 server edition.

#include < stdio.h >

void main()
printf("\nHello World\n");

with gcc, but it kept tellming me that error: stdio.h : No such file or directory

I installed the "build-essential" package, and the stiod.h file is indeed in the /usr/include folder... I'm just a bit confuse what to try next.

Thansk for your help.

November 2nd, 2007, 03:06 AM
what -dev's did you install?

like libc6-dev and libstdc++...-dev?

did you also install g++?

November 2nd, 2007, 03:19 AM
this is what get installed in the "build-essential" package

The following NEW packages will be installed:
binutils build-essential cpp cpp-4.1 dpkg-dev g++ g++-4.1 gcc gcc-4.1 gcc-4.1-base libc6-dev libstdc++6-4.1-dev
linux-libc-dev make patch

November 2nd, 2007, 03:22 AM
you know what, i feel like a noob now...

i had spaces near the brackets... stupid mistake, thanks anyways

November 2nd, 2007, 03:51 AM
nah dont feel like a noob, everyone makes small mistakes in computers. i like to call it learning, myself lol

November 2nd, 2007, 01:41 PM
It's Cool.
Happy compiling.