*BSD News Article 97449


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!howland.erols.net!surfnet.nl!news-zh.switch.ch!news-ge.switch.ch!news.rccn.net!morgana.mat.uc.pt!usenet
From: Pedro Miguel das Neves Valenca Rocha <pmrocha@isr.uc.pt>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Native code in Java over FreeBSD (shared libraries)
Date: Mon, 09 Jun 1997 17:18:33 +0100
Organization: FCTUC
Lines: 19
Message-ID: <339C2CD8.229A24E8@isr.uc.pt>
NNTP-Posting-Host: sirius.isr.uc.pt
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Mailer: Mozilla 4.0b3C (X11; I; SunOS 5.5 sun4m)
X-Priority: 3 (Normal)
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:42670

Hi, I'm trying to use native code (the hello world! example) in Java
and I'm having some trouble. I think I may be creating the shared
library the wrong way. I'm doing it as follows:

	cc -fpic -DPIC -pipe -I {the include directories} -c C_files -o test.so
	rm -f libtest.so
	ld -Bshareable -x -o libhello.so `lorder hello.so|tsort -q`

	I get no warnings or errors. When I try running the java code (or any
other that tries to use the library) I get:
	"Undefined symbol _HelloWorld_displayHelloWorld called from java....

	Any ideas?

TIA
-- 
Pedro Miguel das Neves Valença Rocha
pmrocha@isr.uc.pt
Coimbra, Portugal