can't compile basic hello world on RHEL



I must be missing something major, because I can't get the following
simple program to compile:

#include <stdio.h>

int main(){
fprintf(stderr,"Hello world\n");
}

The error I get from doing "gcc -o testme testme.c" is:

/tmp/ccMJ0qjZ.o(.text+0x28): In function `main':
: undefined reference to `__getreent'
collect2: ld returned 1 exit status

I already did "up2date gcc" and "up2date compat-gcc-32-c++", but I
still get the same error. If I try to compile this on a Mac OS X
system, or on another linux system we have, everything is fine.

Does anyone have a clue as to what's going on?

Thanks,

Mike

.



Relevant Pages

  • Re: Undefined reference to main
    ... : undefined reference to `main' ... collect2: ld returned 1 exit status ... This happens whether I compile the code using a makefile or normally ...
    (comp.os.linux.development.apps)
  • Linking error
    ... I'm trying to compile and link a Program using the Lapack Library. ... : undefined reference to `MAIN__' ... collect2: ld returned 1 exit status ...
    (comp.lang.fortran)
  • Re: cant compile basic hello world on RHEL
    ... collect2: ld returned 1 exit status ... If I try to compile this on a Mac OS X ... system, or on another linux system we have, everything is fine. ...
    (linux.redhat)
  • Re: Quines
    ... by smr. ... When I try to compile it, ... : undefined reference to `main' ... collect2: ...
    (comp.lang.c)
  • Re: Undefined reference to main
    ... : undefined reference to `main' ... collect2: ld returned 1 exit status ... This happens whether I compile the code using a makefile or normally ...
    (comp.os.linux.development.apps)