__attribute__((constructor)), shared object files and C++...

Phil Edwards phil@jaj.com
Thu May 8 20:07:00 GMT 2003


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



More information about the Gcc mailing list