Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Winelib to port a Windows-only GUI toolkit

I love just about everything about the DFL GUI toolkit for D except that it only works on Windows because it's basically a pretty, high-level wrapper around the Windows API. How hard would it likely be to simply port such a toolkit to Linux (I don't really care about any other OS besides Windows and Linux) using Winelib? What are the odds that if I compiled such a library on Linux and linked it with Winelib it would mostly "just work"? What non-obvious steps might be involved?

Note: For those who are unfamiliar with D's methods of working with C code, C code can be called directly from D. You just need to translate the header file to D (this is already done for the Win32 headers, but not the Winelib headers. I'm not sure if the Winelib headers even need to be translated or if the Windows headers are good enough.), compile the C code with a C compiler, and link the C object files in.

like image 751
dsimcha Avatar asked Nov 15 '22 09:11

dsimcha


1 Answers

You don't need to use winelib at all if you are already building for windows. Winelib exists only to provide a windows build environment under wine on a wine supported non-x86 platform (e.g. linux ppc). No need to use it at all if your build system is already building windows binaries (no performance benefit).

One thing you will have to do is make sure that the Win32 API calls that the DFL dlls use work under wine (you'd have to do this even if you used winelib).

So the short of it is, no need to use winelib just try under wine the dlls you are already building for windows with your test app and file wine bugs for any api calls that aren't supported. :)

like image 78
JohnKlehm Avatar answered Dec 23 '22 03:12

JohnKlehm