From: khan AT xraylith DOT wisc DOT edu (Mumit Khan) Subject: Re: dll, java, gcc, cygwin 23 Oct 1998 17:49:54 -0700 Message-ID: References: <199810211705 DOT MAA23362 AT emerald DOT ccrl DOT mot DOT com> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII To: Glen Fullmer-EGF002 Cc: gnu-win32 AT cygnus DOT com 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 AT 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 "gnu-win32-request AT cygnus DOT com" with one line of text: "help".