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: Paul Pluzhnikov
Subject: Re: g++-2.95 statically compiling
Date: Thu, 18 Jan 2007 07:58:08 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

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,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

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