Re: no Hello World!!



rwittenberg@xxxxxxxxxxxxxxx wrote:
I want to be able to compile with my Fedora Core 6 system and run the
executable on my Debian Woody system. I used to compile on a Red Hat
9.0 box and run on Debian Woody earlier and that worked just fine.
Here is what I see in the 2 scenarios.

Why didn't you tell from the start that you compiled the program on
one machine and then copied it to another one, trying to run it
there? That normally doesn't work and immediately explains your
troubles.

Case 1 (compiled on FC6 run on Debian):

On compiling on FC6 and

on FC6

#ldd a.out
linux-gate.so.1 => (0x0057f000)
libc.so.6 => /lib/libc.so.6 (0x00ad0000)
/lib/ld-linux.so.2 (0x00ab3000)

After transfering file
on Debian

#ldd a.out
/usr/bin/ldd: line 1: 3164 Floating point
exceptionLD_TRACE_LOADED_OBJECTS=1 LD_WARN= LD_BIND_NOW=
LD_LIBRARY_VERSION=$verify_out LD_VERBOSE= "$file"

Case 2 (compiled on RH9 and run on Debian):

On compiling on RH9 and

Running on RH9

# ldd a.out
libc.so.6 => /lib/tls/libc.so.6 (0x42000000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

After transfering file
on Debian

# ldd a.out
libc.so.6 => /lib/tls/libc.so.6 (0xb7e27000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb7f62000)

Well, obviously FC6 and Woody are different enough systems to
make it impossible to simply copy a program from one machine
to the other and having it run on there, while RH9 and Woody
are similar enough. Probably different versions of the libc or
ld-linux.so, different locations of where the essential libra-
ries are, and maybe different additional libraries required
(as you can see, FC6 needs some linux-gate.so that probably
doesn't even exist on the other systems). Forget about that
and get used to compiling your programs on the target machine,
you're in for a lot of grieve otherwise. Or link statically
if you really have no alternatve to moving the binary, that's
the only more or less practical method.

Regards, Jens
--
\ Jens Thoms Toerring ___ jt@xxxxxxxxxxx
\__________________________ http://toerring.de
.



Relevant Pages

  • Re: most popular packaging system
    ... >> Find out that to compile it you need libxyz, libabc, and an updated ... something on my debian woody server that isn't in the woody release (e.g. ... html mail or attachments will go in the spam ...
    (comp.os.linux.misc)
  • Re: no Hello World!!
    ... executable on my Debian Woody system. ... I used to compile on a Red Hat ... box and run on Debian Woody earlier and that worked just fine. ...
    (comp.os.linux.development.apps)
  • Re: no Hello World!!
    ... Thanks for helping get to the bottom of this. ... knows of a cool howto online please post the URL. ... An alternative would be to install full debian woody (or enough to ... compile and test on debian with same kernel and libs as target. ...
    (comp.os.linux.development.apps)
  • Re: no Hello World!!
    ... I used to compile on a Red Hat ... box and run on Debian Woody earlier and that worked just fine. ... Case 1 (compiled on FC6 run on Debian): ... #ldd a.out ...
    (comp.os.linux.development.apps)
  • Re: Unidentified subject!
    ... > I'm trying to compile a 2.4.22 kernel on a Debian Woody. ... files) into an executable module (or larger object file or library) and ...
    (Debian-User)