help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: g++-2.95 statically compiling


From: fangee
Subject: Re: g++-2.95 statically compiling
Date: Sat, 20 Jan 2007 12:31:06 GMT
User-agent: Thunderbird 1.5.0.9 (X11/20070103)

Following yuor suggestion I gave up statically compiling and I found a better (I think) solution: pass to the linker the option -Wl,-rpath.
Regards,
f.

Paul Pluzhnikov wrote:
fangee <fangee80NOSPAMNO@gmail.com> writes:

I'm facing a problem trying to statically compile a simple c++ prog,

Unless your target is an embedded system, statically linking it
makes it significantly *less* portable (basically it will work only
on the system on which it was compiled).

Usually people want static linking due to mistaken belief that
static executables are more portable.


Using g++ 2.95.4 (I must use this to compile a much more complex
program) this way I get the following output:

   $ g++ -static tmp.cpp

   /usr/bin/../lib/libc.a(syslog.o): In function `__vsyslog_chk':
   (.text+0x6dd): undefined reference to `_Unwind_Resume'

Apparently your libc.a was compiled with a newer version of gcc.
AFAICT, gcc-2.95.x did not define or use _Unwind_Resume ...

Any suggestion?

Abandon the goal (which is likely mis-guided to begin with), or
try to link on an older glibc compilation.

FWIW, I can link with "/usr/local/gcc-2.95.3/bin/g++ -static ..."
on RedHat 6.2 with glibc-2.1.3-15

Cheers,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]