From: Stanley E B. <sta...@zi...> - 2002-07-30 14:13:38
|
I am trying to access an exported function in Java's jawt.dll called GetAWT. I exported from the DLL using pexports into jawt.def which looks like this: ----------------------------------------------------------------- LIBRARY jawt.dll EXPORTS _JAWT_GetAWT@8 ----------------------------------------------------------------- I then created the link library using dlltool and copied it into the lib directory ----------------------------------------------------------------- dlltool --dllname jawt.dll --def jawt.def --output-lib libjawt.a -k ----------------------------------------------------------------- Added the library in my makefile during the dllwrap step ----------------------------------------------------------------- -ljawt ----------------------------------------------------------------- Compiling I receive the following error: ----------------------------------------------------------------- gui_Canvas.c:28: undefined reference to `_imp__JAWT_GetAWT@8' ----------------------------------------------------------------- The java distribution on windows includes MS LIB files. Using nm of jawt.lib gives me this: ----------------------------------------------------------------- jawt.dll: 00000000 i .idata$2 00000000 i .idata$4 00000000 i .idata$5 00000000 i .idata$6 000420ff a @comp.id 00000000 I __IMPORT_DESCRIPTOR_jawt U __NULL_IMPORT_DESCRIPTOR U jawt_NULL_THUNK_DATA jawt.dll: 000420ff a @comp.id 00000000 I __NULL_IMPORT_DESCRIPTOR jawt.dll: 000420ff a @comp.id 00000000 I jawt_NULL_THUNK_DATA jawt.dll: 00000000 I .idata$4 00000000 I .idata$5 00000000 I .idata$6 00000000 T .text 00000000 T _JAWT_GetAWT@8 U __IMPORT_DESCRIPTOR_jawt 00000000 I __imp__JAWT_GetAWT@8 ----------------------------------------------------------------- The last few lines are the kickers. It has both _JAWT_GetAWT@8 and __imp__JAWT_GetAWT@8 defined. What gives? I tried adding __imp__JAWT_GetAWT@8 to the def file but this only leads to the program that uses the DLL complaining about not finding the entry point in the DLL. |