I believe glibc2 has changed _xstat to __xstat in the dynamic libs. I
worked around this with my old Motif 2.0, by redefining _xstat to be
__xstat. This can be done with -Xlinker flags to gcc. Sorry don't have
the makefile with me at the moment. This worked on my program Xinvest,
but not Xquote, had to statically link that to get it to work. [I've
added the more appropriate Linux group to the discussion.]
BTW, you are certainly using the Motif shared library as you have not
specified the -static flag to gcc.
> I am trying to compile a motif program but I get some undefined
> reference symbols
> _xstat. It has something to do with the shared library version of
> libXm.so but I am
> not using the shared library .
> The error is :
> gcc -o xmtutor widgets.o typeconverter.o runio.o sectionio.o init.o
> callbacks.o xmtutor.o -L/usr/X11R6/lib -lXm -lXt -lm -lXpm -lX11 -lXIE
> /usr/X11R6/lib/libXm.so: undefined reference to `_xstat'
> collect2: ld returned 1 exit status
> I am using redhat 6.1 and Linux mandrake 7.0.2. Does anyone know what's
> I linked the library in the right order, so that can not be the problem.
> Johan den Boer