[geeks] OSMesa library on solaris 10 x86, unresolved symbol

Francois Dion francois.dion at gmail.com
Thu Aug 24 12:08:45 CDT 2006


I have an application that wont run in a zone because it uses glX
calls to create an *offscreen* buffer to render OpenGL to it. Problem
is that glX needs an Xserver. I've tried using Xvfb and altough that
works in a zone, glX calls dont seem to work with Xvfb. I'm
researching that further, but in the meantime, I figured let's change
the program to use OSMesa instead of glX. OSMesa is part of mesa and
on Solaris 10 is found under /usr/X11/lib like GL and GLU (which are
also the mesa variety, hardware support of OpenGL on Solaris x86 is
limited to nvidia at this point).

I've been exchanging on the Solaris x86 list about an issue I'm having
to simply -lOSMesa with either gcc or Sun cc (Studio 11). I'm pasting
the detail below, in the hope that somebody has been through this.
Basically, driDispatchRemapTable is an unresolved symbol in
/usr/X11/lib/GL/libOSMesa.so.

Any toughts?

On 8/22/06, John Martin <john.m.martin at sun.com> wrote:
> Francois Dion wrote:
>  >
>  > Trying an alternative to glX calls and offscreen buffer, I figured I
>  > could add a check to use glX when in global zone and simply run OSMesa
>  > calls when in a non global zone.
>  >
>  > so I made a simple test, and added -lOSMesa to my makefile.
>  >
>  > Not good:
>  > ld: fatal: library -lOSMesa: not found
>  Try building your app without -lOSMesa, instead just:
>
>  -L/usr/X11/lib -lGLU -lGL
>
>  With S10 U3, you won't need the "-L" anymore.

That sounds good. So I'll have 2 things to look forward to in U3, that
and bootable zfs.

Back to your suggestion, I get:
Undefined                       first referenced
 symbol                             in file
OSMesaMakeCurrent                   mesaOffscreen.o
OSMesaCreateContext                 mesaOffscreen.o

Since I've replaced the glX calls by OSMesa calls...

I'm testing that on a 32 bit laptop (dell d600) if it makes any difference.

If you want to test if your linker works on your end, save the
following in a file called osmesa.c (the most minimalistic test I can
come up with to test linking):

int OSMesaMakeCurrent();

main()
{
       OSMesaMakeCurrent();
}


and then the command line:
cc -L/usr/X11/lib/GL -lOSMesa osmesa.c
"osmesa.c", line 4: warning: old-style declaration or incorrect type for: main
Undefined                       first referenced
 symbol                             in file
driDispatchRemapTable               /usr/X11/lib/GL/libOSMesa.so
ld: fatal: Symbol referencing errors. No output written to a.out

or:
 cc -L/usr/X11/lib/GL -lOSMesa -lGL -lGLU osmesa.c
"osmesa.c", line 4: warning: old-style declaration or incorrect type for: main
Undefined                       first referenced
 symbol                             in file
driDispatchRemapTable               /usr/X11/lib/GL/libOSMesa.so
ld: fatal: Symbol referencing errors. No output written to a.out


so the bottom line, OSMesa has a dependency on something...



More information about the geeks mailing list