Re: GTK+ on windows



I have created several cross-platform gtk programs, and while it took a while to get right the first time, my development is now so trustworthy that I can do all my development under Linux and then once it works, just generate a windows installer and I know that it will just work. I am using mingw for all my windows gtk work, and usually I'm doing the windows generation through cross compilation. My build environment is scons with a SConstruct file that has a couple of if's in the beginning to resolve the differences between the different environments.

Trying to say that using mingw instead of MSVC makes the result less native is as absurd as saying that using the Intel compiler would make it less native. Of course there are people who for whatever reason prefer the Studio IDE, and I respect that. (Can you configure Studio to use gcc instead of microsoft like you can make it use the intel compiler?) In any case, as gtk is a pure c-program, there are no ABI differences between the visual compiler and gcc. So why can't you just use the standard gtk distribution together with the studio compiler? If it doesn't work, I think it would make sense to enter whatever #ifdef's into the headers to support the microsoft compiler. Having two sets of "official" gtk windows environment sounds quite messy.

Regarding supplying missing asprintf() etc support, isn't that the job of glib? Are there reallly dependencies for glib that are not correctly supplied?

One more thing. After a long time of DLL-hell it has been settled that each application provides an entire copy of all the gtk runtime environment. This solves the earlier problem of competing gtk environments, and one application causing others not to work. Please don't try to generate an "official" gtk version that everybody should settle on. It hasn't worked in the past. The overhead of the entire gtk distribution isn't more than a around 12M which is negligible with todays hard disks. The only downside with this process is that you have to do theming separately for each application. But if you use the wimp theme, you inherit the windows theme in any case.

Regards,
Dov




On Tue, Oct 13, 2009 at 15:16, Ted Bullock <tbullock comlore com> wrote:
In the background of writing some software on top of GTK+ I have
started working on making my application build on windows rather than
just my opensuse-factory desktop.

Looking at the the information on gtk.org I thought to myself, maybe I
can just create a visual studio project file for the entirety of GTK
and have my little application sitting along side all the other
components.  This way, I can ensure binary compatibility and can take
advantage of all the dependency management and debugging facilities
included with visual studio and just maybe flowers will spring up on
the desert and all that.

I have had a reasonable amount of success, along with a reasonable
amount of pain.  Currently about 60% of the dependencies are building
and linking.

However this has got me thinking about what the nature of the
portability problem is here.  Lots of projects have released Windows
GTK binaries at one point or another, but I wouldn't trust that there
is a great deal of ABI compatibility between them.  Currently each
project maintains it's own build system on Windows some of which are
extremely painful and a massive wall to participation.  And all I am
doing with the work on my project is setting up "yet another gtk
distribution".

The amount of fragmentation around GTK on the windows platform is
pretty significant and building a GTK application for windows is not
for the faint of heart (Take a look at the build instructions for
gedit)

Although mingw produces working results, the process is complicated.
Statements like the one on gtk.org about the gnu compiler being an
appropriate toolchain are ill conceived not because there is anything
wrong with the toolchain itself, but rather because it's not native to
the platform.

In response to this and specifically to scratch my own itch I am
starting a new project called Nokomis (Ojibwa spirit who rebuilt the
world from a grain of sand).  Which, while not a fork of GTK will be a
Windows specific compilation of GTK using msbuild very much in the
same way that xenocara implements X for OpenBSD.

Nokomis will provide missing functionality such as asprintf, strlcpy,
strlcat and attempt to track upstream GTK releases.  The targeted
system compiler will initially be the visual C compiler built into the
upcoming Visual Studio 2010 (currently in beta) although any compiler
which can be tied into msbuild will be acceptable.

Basically I want to make GTK a first class citizen on Windows

--
Ted Bullock <tbullock comlore com>
_______________________________________________
gtk-list mailing list
gtk-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]