I'm trying to create a jni dll that uses libgtmathview, but I'm having to link against it statically, because I'm unable to create a dll for the backend ps module (libtool is unable to create a shared library because of undefined references). So I built static libraries for gtkmathview to link my dll against, but I'm having some problems. 

I built gtkmathview using

$CXX=mingw32-g++ ./configure --prefix=/mingw --disable-debug --enable-pipe --enable-shared --enable-ps --disable-svg --enable-gtk=no

I then copied all the static libraries created to /c/mathview. The command to compile my dll is
 
mingw32-g++ -shared -mwindows -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc ${CFLAGS}  -IC:/mathview/lib<blah>.a -IC:/mathview/lib<blah>.a ... ${INCLUDE} objfile1.o objfile2.o objfile3.o ${LDFLAGS} -o <dllname>.dll

where CFLAGS=-g -w -fPIC -std=gnu99 and LDFLAGS=-LC:/MinGW/lib -LC:/MinGW/lib/glut -LC:/MinGW/lib/GLU -LC:/MinGW/lib/GL -LC:/MinGW/lib/glib-2.0 -lopengl32 -lglu32 -lglut32 -lglib-2.0 -lstdc++

This produces several missing reference errors like

c:\sandbox\main\internal\java\com\maplesoft\util\gl2ps\jni/mathml2ps.cc:113: undefined reference to `AbstractLogger::setLogLevel(LogLevelId) const'
c:\sandbox\main\internal\java\com\maplesoft\util\gl2ps\jni/mathml2ps.cc:129: undefined reference to `View::setBoxMLNamespaceContext(SmartPtr<BoxMLNamespaceContext> const&)'
C:/MinGW/include/gtkmathview/MathView/MathMLOperatorDictionary.hh:39: undefined reference to `MathMLOperatorDictionary::MathMLOperatorDictionary()'
build/mathml2ps.o: In function `ZN22MathMLNamespaceContext6createERK8SmartPtrI4ViewERKS0_I17MathGraphicDeviceE':

Any suggestions as what I might be doing wrong?

Thanks.

--
-sultan