Trouble compiling simple hello world program
Hi,
I'm a newbie to linux and have installed debian on my machine. I installed gcc and am trying to compile a really really basic 'hello world' app but am having problems. I'm not sure this is the right thread/forum to post this on so go easy if I'm in the wrong park! The code is thus: Code:
#include <stdio.h> Complex eh? I use the following to compile: gcc -o program main.c I get the followign error messages related to stdio.h: /usr/include/libio.h:332: error: expected specifier-qualifier-list before size_t I have a lot more similar messages. Can anyone help me out? Thanks, Chris. |
What are the first few errors you are getting? It looks like it is not finding some of the header files included by stdio.h.
How did you install gcc? |
Hi neonsignal,
I installed it using : apt-get install gcc The install seems to have worked, I do gcc --version and it goves me Debian 4.3.2-1.1 The remainder of the errors are similar pointing to libio.h and 'expected declaration specifiers' mainly. I'll try to get the log but I'm running a VM and am having difficulty with the shared folders. |
The errors are because size_t and probably other standard types have not been defined.
I expect that one of the first error messages would be a failed include. This might be a path problem, or a package that didn't install properly - in a standard installation, you normally wouldn't have to do anything to get this working. |
Perhaps try installing the following packages:
Code:
apt-get install build-essential libc6-dev |
post all the errors.
|
Thanks neonsignal, that fixed my problem.
I figured a normal install would put all the path declarations in for me and I wouldn't have to do much. Thanks again for the help, I really appreciate it. |
All times are GMT -5. The time now is 02:01 AM. |