views:

265

answers:

2

Please pardon the newbie question, my C is very, very rusty. Trying to build xrunclient from http://www.leftfield.org/~dd/sw.html, on IRIX64, I'm confronted with:

ld32: ERROR: 33 : Unresolved text symbol "XOpenDisplay"

I figure this is because it can't find the proper library, but it finds the header files without complaint. How can I identify which library has that routine defined so I can make sure it's in the library path?

+1  A: 

The answer is libX11.so -- it contains the basic Xlib routines, and you can tell this is an Xlib routine because it starts with a plain "X". If it started with "Xt", then you'd know it's a method in the Xt widget set.

I don't believe that the name of this library has changed in 15+ years, so the compile command shown in the book should work for you. I believe that the library name is also listed in the manpage for the X routines (which of course means that you have to have manpages available, and not everyone does).

Other than that, grep may be your best bet, although grepping across /usr/lib is going to turn up both references to the function and the declaration, so that probably isn't useful. There's also a command-line utility (you are running on Linux, right?) that will show the contents of a .so, which may be useful as well.

Edit: ah, Irix, not Linux; didn't notice that on first read. I think the best approach is going to be finding the manpages.

kdgregory
AFAIK, the X11 libraries on IRIX are actually nicely integrated in `/usr/lib` instead of odd locations like `/usr/openwin/lib` or `/usr/X11R6/lib`, so if the X11 development kit was installed, the linker *should* have picked up the libraries... dunno, it's a mystery to me, too.
ephemient
+3  A: 
Norman Ramsey
http://libsdl.org/ Looks like it contains a bunch of stubs for the Xlib functions so that it can load without libX11 and still operate, but can also load with libX11 and forward calls to it.
ephemient
You'll note that there's a `U XOpenDisplay` entry in `libSDL.a:SDL_x11video.o`. I'm kinda surprised that this funny setup works, but apparently...!
ephemient
nm - that was the utility I was trying to remember
kdgregory