Re: XForms: opengl and shared libraries

Manuel J. Garcia (
Wed, 08 Oct 1997 10:21:13 +1000

To subscribers of the xforms list from "Manuel J. Garcia" <> :

> > the readme mentioned something about compiling the included opengl.c and
> > integrating it into the shared library. i could do the compiling part.. but
> > how do i put it into the shared library? (i've looked up the gcc faq but
> > the link to mit doesn't work). better yet, is there a place where i could
> > find out about this? i'm relatively new to unix (just installed linux).
> The place to look is in the man page for ld or Also refer to
> the mkconfig.h file at the root of the XForms distribution. There
> should be some lines at the bottom which look like
> #
> # this is how the shared library is made
> #
> MKSHLIB=ld -shared -soname $(SHARED_SO) -o $(SHARED_LIB)\
> `ls *.o|grep -v gl.o` ulib/*.o ../xpm-3.4g/lib/libXpm.a

I had the same problem. I wanted to add the file gl.o to the
shared library ( given the files,
libforms.a, and gl.o. Notice that I did not had all the *.o files, so I
could not use
the command used in the mkconfig.h file.

by suggestion of Dr. Zhao I try the following command

ld -shared -soname -o libforms.a gl.o

but still it didn't work, it seems that the problem is when it tries to
link a static library with a shared library.

I still haven't found the solution, in the mean time i'm linking
statically with the gl.o file.


Manuel Julio Garcia
Aeronautical Engineering Dept.
The University of Sydney, NSW 2006

Tel: +2 9351 2342
Fax: +2 9351 4841
To unsubscribe, send the message "unsubscribe" to or see
Xforms Home Page:
List Archive: