Using gcc
Thai Dang Vu
thaid@Cybersoft-VN.com
Thu Mar 28 20:40:00 GMT 2002
Have you tried
gcc -g -Wall -o hello hello.c
yet?
Attention: there's a space between -o and hello.
-----Original Message-----
From: Francisco Mendez [mailto:iframe@prodigy.net.mx]
Sent: Friday, March 29, 2002 11:29 AM
To: gcc-help@gcc.gnu.org
Subject: Using gcc
Hi:
I'm totaly new to c programming, I'm using Red Hat 7.2. Recently I got
the book "Practical C Programming" by Steve Oualline (O'Reilly). In Ch-2
a simple Hello World program is described,
[File: hello/hello.c]
#include <stdio.h>
int main()
{
printf("Hello World\n");
return(0);
}
The file is saved as hello.c
, following are the instructions for compiling from the command line:
gcc -g -Wall -ohello hello.c
The sample fails to compile, unstead I get the following Messages:
hello.c:1: parse error before '['
In file included from usr/include/bits/types.h:143,
from usr/include/stdio.h:36,
from hello.c:2:
usr/include/bits/pthreadtypes.h:48: parse error before 'size_t'
usr/include/bits/pthreadtypes.h:48: warning: no semicolon at end of
structure union
usr/include/bits/pthreadtypes.h:51: parse error before '__stacksize'
usr/include/bits/pthreadtypes.h:51: warning: data definition has no type
or storage class
usr/include/bits/pthreadtypes.h:52: warning: data definition has no type
or storage class
In file included from usr/include/_G_config.h:44;
from usr/include/libio.h:32,
from usr/include/stdio.h:65,
from hello.c:2:
usr/include/gconv.h:72: parse error before 'size_t'
usr/include/gconv.h:85: parse error before 'size_t'
usr/include/gconv.h:94: parse error before 'size_t'
usr/include/gconv.h:170: parse error before 'size_t'
usr/include/gconv.h:170: warning: no semicolon at end of struct or union
usr/include/gconv.h:173: parse error before '}'
usr/include/gconv.h:173: warning: data definition has no type or storage
class
In file included from usr/include/libio.h:32,
from usr/include/libio.h:65,
from hello.c:2:
usr/include/_G_config.h:47: field '__cd' has incomplete type
usr/include/_G_config.h:50: field '__cd' has incomplete type
usr/include/_G_config.h:53: confused by earlier errors, bailing out
So it seems impossible to compile this simple programm. Whatis wrong?
Any help in this respect will be appreciated. Thanks in advance.
Francisco Mendez.
More information about the Gcc-help
mailing list