Re: can't compile basic hello world on RHEL



On 13 avr, 22:54, "mhearne808[insert-at-sign-here]gmail[insert-dot-
here]com" <mhearne...@xxxxxxxxx> wrote:
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

Sound like a libxx not same as the one expected. different version.
unset LD_LIBRARY_PATH (check contents first of cause )
the reorder the libraries you probably don't need more than a very few
entries, mine is empty!
check also
cat /etc/ld.so.conf
/usr/kerberos/lib
/usr/X11R6/lib
/usr/lib/qt-2.3.1/lib
/usr/local/lib
/opt/sybase-11.9.2/lib

REgards
Zoot

.



Relevant Pages

  • g77-3.4, ubuntu 7.10
    ... sudo apt-get install g77-3.4 ... But when I try to compile this is what I get ... collect2: ld returned 1 exit status ...
    (Ubuntu)
  • 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)
  • Microchip PIC porgrammer
    ... gpsim won't compile on my machine: ... collect2: ld returned 1 exit status ...
    (comp.os.linux.misc)
  • dyld_stub_binding_helper undefined symbol / crt1.o link error
    ... I am trying to compile on Mac OS X 10.4 my C program. ... link phase where I get (gcc 4.01): ... collect2: ld returned 1 exit status ...
    (comp.lang.c)
  • Problems with G++ - Undefined symbol: .
    ... but I can't compile a hello world program. ... collect2: ld returned 8 exit status ... Is 4.0.0 the best version of g++ (I found it on the AIX linux tool kit). ...
    (comp.unix.aix)