Strid
July 3rd, 2007, 04:06 AM
I want to compile some code written in C. It think I've installed every package related to C I could find. Especially, I took care that build-essential is installed, because that is what I found in about every thread (seems to be a lot!) where other guys have the same problem.
anders@fx60:~$ cd Desktop/
anders@fx60:~/Desktop$ sudo apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
The following packages were automatically installed and are no longer required:
libid3-3.8.3c2a
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
anders@fx60:~/Desktop$ gcc -o test HelloWorld.c
HelloWorld.c:1:20: error: stdio.h: No such file or directory
HelloWorld.c: In function ‘main’:
HelloWorld.c:5: warning: incompatible implicit declaration of built-in function ‘printf’
HelloWorld.c:4: warning: return type of ‘main’ is not ‘int’
anders@fx60:~/Desktop$ cat H
HelloWorld.c HelloWorld.c~ Hold.txt~
anders@fx60:~/Desktop$ cat HelloWorld.c
#include < stdio.h>
void main()
{
printf("\nHello World\n");
}
anders@fx60:~/Desktop$
So build-essential is installed and I'm just trying to compile a sample "hello world" I snatched off a tutorial. What other packaged could I be missing? I even tried to reboot after installing build-essential. Still no dice. :(
This is on Feisty btw.
Cheers from a guy whos fluent in Python and Pascal but wants to get into C like all his cool mates. :popcorn:
anders@fx60:~$ cd Desktop/
anders@fx60:~/Desktop$ sudo apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
The following packages were automatically installed and are no longer required:
libid3-3.8.3c2a
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
anders@fx60:~/Desktop$ gcc -o test HelloWorld.c
HelloWorld.c:1:20: error: stdio.h: No such file or directory
HelloWorld.c: In function ‘main’:
HelloWorld.c:5: warning: incompatible implicit declaration of built-in function ‘printf’
HelloWorld.c:4: warning: return type of ‘main’ is not ‘int’
anders@fx60:~/Desktop$ cat H
HelloWorld.c HelloWorld.c~ Hold.txt~
anders@fx60:~/Desktop$ cat HelloWorld.c
#include < stdio.h>
void main()
{
printf("\nHello World\n");
}
anders@fx60:~/Desktop$
So build-essential is installed and I'm just trying to compile a sample "hello world" I snatched off a tutorial. What other packaged could I be missing? I even tried to reboot after installing build-essential. Still no dice. :(
This is on Feisty btw.
Cheers from a guy whos fluent in Python and Pascal but wants to get into C like all his cool mates. :popcorn: