-dlopen self

Erik Poupaert erik.poupaert@chello.be
Wed Mar 19 15:03:00 GMT 2003


I've tried two alternatives:

First alternative:

$ ar -crs lib-swtjni.a swt.o callback.o structs.o

$ gcj -export-dynamic -Xlinker --start-group myprog1.a myprog2.a
lib-swtjni.a -Xlinker --end-group \
	-o
myprog --main=mymain -L/usr/lib -L/usr/X11R6/lib -lgtk-x11-2.0 -lgdk-x11-2.0
\
	-latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgo
bject-2.0 \
	-lgmodule-2.0 -ldl -lglib-2.0

The linking doesn't yield error messages, but it ltdl fails to find the
symbols

Second alternative:

$ gcj -export-dynamic swt.o callback.o structs.o -Xlinker --start-group
myprog1.a myprog2.a -Xlinker --end-group \
	-o
myprog --main=mymain -L/usr/lib -L/usr/X11R6/lib -lgtk-x11-2.0 -lgdk-x11-2.0
\
	-latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgo
bject-2.0 \
	-lgmodule-2.0 -ldl -lglib-2.0

The linking fails, saying "swt.o ... undefined reference to
'g_thread_init'". The symbol is defined, however, in -lglib-2.0.



More information about the Java mailing list