This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: __attribute__((constructor)), shared object files and C++...
- From: Phil Edwards <phil at jaj dot com>
- To: "Pearson, Scott" <scott dot pearson at intel dot com>
- Cc: 'Daniel Jacobowitz' <drow at mvista dot com>,'Muthukumar Ratty' <muthu at iqmail dot net>,"'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>,"'gcc-help at gcc dot gnu dot org'" <gcc-help at gcc dot gnu dot org>
- Date: Thu, 8 May 2003 16:07:38 -0400
- Subject: Re: __attribute__((constructor)), shared object files and C++...
- References: <D9223EB959A5D511A98F00508B68C20C200D30A4@orsmsx108.jf.intel.com>
On Thu, May 08, 2003 at 01:05:04PM -0700, Pearson, Scott wrote:
> For the C++ case, I ended up with the (somewhat similar) sequence:
>
> g++ -fPIC -c libctest.cpp
> g++ -shared -Wl,-soname,libctest.so.1 -o libctest.so.1.0 libctest.o
> ldconfig -v -n .
> ln -sf libctest.so.1 libctest.so
> g++ -o ctest -L. -lctest -lstdc++ ctest.cpp
^^^^^^^^
Don't do that.
--
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace. We seek
not your counsel, nor your arms. Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen. - Samuel Adams