> I compiled a simple Hello World C program on RedHat 5.1 .
> It runs on 5.1 but not 4.2 . In fact, 4.2 doesn't know it's
> there. Typing ./hello in 4.2 yields this error message:
> bash: ./hello: No such file or directory.
> Yes, it has +x permissions for ugo.
> compile command line: g++ -o hello hello.c
> What's wrong? What needs to be done so the program
> runs on both systems?
you're not alone, because I see the same thing. It is surely a result of
compiling for glibc under RH 5.1 and only having libc5 under RH 4.2, but I
have not even been able to work around it by copying the glibc libraries
to the 4.2 system and defining LD_LIBRARY_PATH. I suspect the
libc5-compatible linker/loader is * because it sees things it
doesn't understand in the glibc-compatible executable.
There is some downward-compatibility stuff for RH 5.* at
http://www.veryComputer.com/, which may allow you to compile
libc5-compatible images on your system, but I have not had time to try it,
or even read up on it.