To conclude the X discussion:
I was able to open windows under X11R4 and OpenWindow running on the console with ':0.0' I was able to open windows with 'hostname:0.0' if I was on the Sun console. However, if I was on another X station, it didn't work. Using the string '', however would appear to let XOpenDisplay() look up $DISPLAY on its own, and that *does* work. Actually, I'm not sure I can repeat this every time either...
I thought I'd try and compile Self. Why, when I can add things via dynamic linking? I'm not sure :-) g++ version 2.3.3 runs out of memory at line 2346 of op.h while compiling op.c. I tried another machine with 45Mb of swap allocated (with at least 28Mb free I think), and got the same thing. Could it be 2.3.3 bugs? op.c seems to include a zillion things.
op.h: In method `NonLocalReturnOp::NonLocalReturnOp (struct Name*, struct Name*, struct Name*, struct Use* (= 0 ), struct Use* (= 0 ), struct Use* (= 0 ))': In file included from _op.c.incl:118, from op.c:13: op.h:2346: virtual memory exhausted lock_run failed on "turing" with status = 1. ld.so: warning: /usr/lib/libc.so.1.6 has older revision than expected 7
Thanks for everyone's help.