This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Using gcc

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");

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 
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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]