building shared libs with g++ 2.95.2 on HP-UX 11

Martin Sebor sebor@roguewave.com
Sat Sep 9 16:35:00 GMT 2000


Hi,

I'm wondering if anyone knows how to prevent the linker errors (shown
below) I'm getting when building shared libs on HP-UX 11 (I know it's
not a supported platform).

Compiling and linking in the same step seems to work but I'd prefer not
to have to do that.

Thanks in advance
Martin


$ echo "void foo () { }" > t.cpp ; gcc -c -fPIC t.cpp && gcc t.o -shared
-o libt.sl
/usr/bin/ld: DP relative code in file /var/tmp/ccyhoDuR.o - shared
library must be position
    independent.  Use +z or +Z to recompile.
collect2: ld returned 1 exit status


More information about the Gcc-bugs mailing list