Re: DLL binding
- Posted by "Cuny, David at DSS" <David.Cuny at DSS.CA.GOV> Jul 07, 2000
- 453 views
Thierry wrote: > Plus, my goal with using euphoria is to compile > both for windows and linux the same programs, how > to do that easily (compatibility between Linux > XWindows and Windows GDI) ? Unfortunately, there is no complete library that runs in both Windows and Linux. At one point, I was actively working on a library called Llama (http://www.lanset.com/dcuny/llama.htm). On the Windows side, it makes direct calls to the Windows GDI. On the Linux size, it calls the GTK+ library. I stopped working on the library when I started running into problems working with the GTK+ data structures because my conversion of the GTK+ include files was buggy. There were also a few cross-platform issues. While the Llama stuff is incomplete and a bit buggy, the code is still probably good enough to be useful. [side note: Having a library like SWIG (http://www.swig.org/index.html) that automatically generated wrappers for Euphoria would be *very* helpful. Anyone wanna write one?] I also made an abortive attempt to write a low-level API library that would run on Windows, DOS and X Windows called the Portable Windows Library (http://www.lanset.com/dcuny/mwin.htm). It wasn't a bad idea, I just never finished it. If you want low-level GDI compatibility, you might want to take a look at it. Unfortunately, the X Window portion is the least finished of the libraries. Irv Mullins has wrapped GraphApp (http://www.cs.usyd.edu.au/~loki/graphapp/), which is a cross-platform library running on Windows, X Windows and the Macintosh. You can find his library at the Euphoria site. Unfortunately, I've been told that there are serious problems that prevent the Windows version of the library from being usable by Euphoria, so it's pretty much a X Windows only port. A viable option is to write your own wrapper, using GraphApp for Linux, and Win32Lib for Windows. It would be a kludge, but you wouldn't have to code everything from scratch. There are a number of cross-platform toolkits out there. Some are free (GTK+, FLTK, wxWindows, MGL), others are less so (Qt, ZINC). Most are C++ based, which makes them a bit tricky to wrap into a DLL. Personally, I think that GTK is the best basis for X Window coding in Euphoria. The *easiest* approach would be to write your code in Win32Lib and run it in Linux using WINE (http://www.winehq.com). It's been a while since I've run Win32Lib under WINE, but it worked pretty well when I tried it last. When v1.0 of WINE is finally released, I'll probably bug Robert to see if he can create a version of Euphoria that's linked to the WineLib. I suspect that it's going to be pretty darned big, though. Sorry I can't come up with anything that's truly 'simple'. I should have a computer running Linux in a few more weeks, and I might dust off some of the projects then. -- David Cuny