Hi ALL, I'm trying to port some windows program to Linux using Wine. I have C++ source code with Windows DLLs functions calls. The question is: how can I load DLL under Linux and call Windows function? I've tried LoadLibraryA(), PE_LoadLibraryExA() and SERVER_START_REQ( create_file ) without success. Do you know easy way to use Wine's staff to load Windows DLLs? Thanks, Oleg Lyamtsev.
You need to look into porting it to WineLib, have a look through the archives, Dimi Paun has been having fun with that lately. I think there might be docs on the site too. The first step is to get it building using MinGW on Windows iirc, using the standard Linux build system and I think the Wine headers. Once that's working, compiling it into a linux .so file should just be a case of altering a couple of environment variables and compiling it. Note that for various reasons I won't go into here, you'll end up with a .so file (ie a linux dll) not an executable. You'll still need to run "wine foo.so" to make it work, so a WineLib port is generally useful if you're intending to later integrate it with some Linux native APIs - if you simply want it to run on Linux and be done with it, there's little point, you might as well just run the windows .exe On Wed, 2003-02-19 at 02:09, Oleg Lyamtsev wrote:
Hi ALL,
I'm trying to port some windows program to Linux using Wine. I have C++ source code with Windows DLLs functions calls. The question is: how can I load DLL under Linux and call Windows function? I've tried LoadLibraryA(), PE_LoadLibraryExA() and SERVER_START_REQ( create_file ) without success. Do you know easy way to use Wine's staff to load Windows DLLs?
Thanks, Oleg Lyamtsev.
-- Mike Hearn <m.hearn(a)signal.qinetiq.com> QinetiQ - Malvern Technology Center
On February 18, 2003 09:09 pm, Oleg Lyamtsev wrote:
The question is: how can I load DLL under Linux and call Windows function?
Yes, you can, but you have to do it froma Winelib app. The simplest way is to follow Mike's advice: first develop your application under Windows using MinGW (including GNU make & Co.). Once that works, just take everything as is, change the CC, CXX and WRC definitions in your Makefile to: CC = winegcc CXX = wineg++ WRC = wrc and things should just work! :) Of course, you may need to run winemaker once on your source to help you translate include directive that use \ instead of /, or wrong case in filenames. Please report any problem you may have, and we'll try to help. You may find some interesting info on my Winelib page: http://www.dssd.ca/wine/Winelib-Apps.html Good luck! -- Dimi. <http://www.dssd.ca/wine/>
participants (3)
-
Dimitrie O. Paun -
Mike Hearn -
Oleg Lyamtsev