directions for porting my own code using 3rd party dll

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
sancts
Newbie
Newbie
Posts: 2
Joined: Sun May 24, 2009 8:19 am

directions for porting my own code using 3rd party dll

Post by sancts »

Hi

I have a c++ project Im working on under windows.
it uses a 3rd party library (ie, i have headers and dll).

mostly for development I'd like to be able to work on it under linux. and i thought that should be easy with wine.

but now i read through the Winelib User's Guide and Im somewhat lost.
its talking about winemaker and bad cases of filenames, generating makefiles and stuff.

Im pretty sure thats not an issue in my situation. I can compile my code using g++ and the 3rd party headers(almost - theres something related to some macros inside these headers ... but i think i should be able to resolve that)
but i cant link it (obviously - its .dll )

can someone give me some hint about how to proceed, what to read?

thx
Thunderbird
Level 5
Level 5
Posts: 336
Joined: Mon Nov 24, 2008 8:10 am

Post by Thunderbird »

It is not possible to simply use winelib for linking to a win32 dll. You have to compile ALL of your code using winegcc/wineg++, so your whole app will depend on wine. The reason for this is that wine needs to do a lot of magic (registry, file system, windows memory layout ...).

If you don't want that then the only way is to write a small winelib app and use some form of IPC to communicate between the linux and winelib app (e.g. using unix sockets or whatever). Look at the wine-devel archive for discussions about this.
User avatar
DanKegel
Moderator
Moderator
Posts: 1164
Joined: Wed May 14, 2008 11:44 am

Re: directions for porting my own code using 3rd party dll

Post by DanKegel »

sancts wrote: I have a c++ project Im working on under windows.
it uses a 3rd party library (ie, i have headers and dll).

mostly for development I'd like to be able to work on it under linux. and i thought that should be easy with wine.

but now i read through the Winelib User's Guide and Im somewhat lost.
Don't use Winelib... use mingw on linux to build your app, then run it with
wine. Much easier.
sancts
Newbie
Newbie
Posts: 2
Joined: Sun May 24, 2009 8:19 am

Post by sancts »

thanks for these hints
Thunderbird wrote:It is not possible to simply use winelib for linking to a win32 dll. You have to compile ALL of your code using winegcc/wineg++, so your whole app will depend on wine.
well so far that doesnt sound all too scary. that simply means setting CXX=wineg++ doesnt it?
Thunderbird wrote:The reason for this is that wine needs to do a lot of magic (registry, file system, windows memory layout ...).
even if my code has no notion whatsoever about registry, etc? i dont use any libraries from MS, like MFC or whatever (dont even know them).
Thunderbird wrote:If you don't want that then the only way is to write a small winelib app and use some form of IPC to communicate between the linux and winelib app (e.g. using unix sockets or whatever). Look at the wine-devel archive for discussions about this.
now, that sounds scary :(
DanKegel wrote:Don't use Winelib... use mingw on linux to build your app, then run it with wine. Much easier.
ok, i think ill look into that.
do you know whether thats also possible under macosx?

thanks
Locked