Subject: Re: dll, java, gcc, cygwin
From: [email-masked] (Mumit Khan)

23 Oct 1998 17:49:54 -0700
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
To: Glen Fullmer-EGF002 <[email-masked]>
Cc: [email-masked]

On Wed, 21 Oct 1998, Glen Fullmer-EGF002 wrote:

> I thought others might be interested in this letter I sent to Mumit:

(thanks for sending it to gnu-win32 as well; it's more productive than
sending it to just me, and that's I ask folks to send it to the list
and perhaps copy me if they so wish.)

> I tried using your dllwrap tool and method to create the JNI HelloWorld
> example and it failed as it couldn't find the native routine in the library,
> whereas Andrew Mickish's method:
> 	
> 	http://www.andrew.cmu.edu/~am2q/HelloWorld.zip 
> 
> worked fine for the HelloWorld code. Looking at the code I can't see any
> glaring differences.  His makefile uses the loader/dlltool/loader/dlltool
> method.  I tried using Andrew's example on a larger piece of code and it
> behaves the same as yours, i.e. the library loads but it can't find the
> routines within the library.  Perhaps his can only load one routine?  ;-)
> Any hints?

Whenver loading fails, and you know that it's there, it's typically a
question of calling the correct "name". For my applications, my load
routines check for "foo" and "_foo" when asked to load "foo" to avoid
MSVC vs GCC symbol naming issues.

Are you creating .def files yourself? Are you checking to make sure
that the decoration is correct (stdcall attribute adds those pesky
@[num] at the end of symbols?

Check the export table/ordinals in the DLL for the symbol definitions.
If you have MSVC, you can use 'dumpbin /exports'; otherwise use
`objdump -p'.

> I had to set DLL_LDFLAGS = -Wl,-e,_dll_entry@12 to avoid errors.

The DLL entry point is of course a function of that particular
application.  Most are content with the default, but some need
special ones. 

Regards,
Mumit

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".