waterson79
2010-Mar-08 09:19 UTC
[Wine] for help:how to call a windows dll in linux by java program!
hello,everyone! I have encountered a problem when i want to call a windows dll in linux by java program, pls help me ! For the absence of the C source code, i want to migrate the windows dll to the linux ,which is called by a java program, named getDecode.dll. The following is my steps: [root at CGSL-N31 wine]# winedump spec -I. getDecode.dll Contents of getDecode.dll: 360530 bytes 1 named symbols in DLL, 1 total, 1 unique (ordinal base = 1) Done dumping getDecode.dll Export 1 - '_Java_com_zte_ums_zxnm01_zxss_toolkit_trace_common_getDecode_getH248BinDecode at 28' ... [Not Found] [root at CGSL-N31 wine]# winebuild --def -E getDecode.spec -o getDecode.def [root at CGSL-N31 wine]# winegcc -I/home/wine/wine-1.1.32/include -I. -lgetDecode getDecode_main.c -o getDecode_main.so -D__WINESRC__ -L. -L/usr/local/lib -lwine -lwinecrt0 -shared -specs=./getDecode.spec gcc: specs file malformed after 139 characters winegcc: gcc failed The following is the content of getDecode.spec file: # Generated from getDecode.dll by winedump 1 stub _Java_com_zte_ums_zxnm01_zxss_toolkit_trace_common_getH248Decode_getH248BinDecode The following is the content of getDecode_main.c file: /* * getDecode.dll * * Generated from getDecode.dll by winedump. * * DO NOT SUBMIT GENERATED DLLS FOR INCLUSION INTO WINE! * */ #include "config.h" #include <stdarg.h> #include "windef.h" #include "winbase.h" #include "getDecode_dll.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(getH248Decode); BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved); switch (fdwReason) { case DLL_WINE_PREATTACH: return FALSE; /* prefer native version */ case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls(hinstDLL); break; case DLL_PROCESS_DETACH: break; } return TRUE; } /****************************************************************** * _Java_com_zte_ums_zxnm01_zxss_toolkit_trace_common_getH248Decode_getH248BinDecode at 28 (GETH248DECODE.1) * * */ #if 0 __stdcall GETH248DECODE__Java_com_zte_ums_zxnm01_zxss_toolkit_trace_common_getH248Decode_getH248BinDecode() { /* @stub in .spec */ } #endif My question is :what's wrong i have made?why can't i succeed to do the winegcc?what is the proper way to get the .so file?thank you in advance,thank you!
oiaohm
2010-Mar-08 15:26 UTC
[Wine] Re: for help:how to call a windows dll in linux by java program!
waterson79 its not another interface for this by any chance. http://www.erlang.org/project/megaco/index.html If so don't bother messing around with the windows dll just port accross to native.