Warner Young
Warner Young

Reputation: 111

What are some choices to port existing Windows GUI app written in C to Linux?

I've been tasked with porting an existing Windows GUI app to Linux. Ideally, I'd like to do this so the same code base can be used to build either the Windows version or the Linux version. I'll be doing my work on Ubuntu 9.04. After searching around, it's unclear to me what tools are best suited to help me with this.

A list of loose requirements would be:

  1. The code is in C, not C++, and should compile to build both Windows and Linux versions. Since it's existing code, and fairly large, converting to a managed language like .NET is out of the question for now.

  2. I would prefer if I can use the same dialogs in both systems. In Windows, putting up a dialog is pretty simple. You build the dialog in the Resource Editor in Visual Studio, then call DialogBox() API, and handle the event messages. I would really like to find something that can do the equivalent on the Linux side.

  3. It would also be nice to have a good IDE similar to Visual Studio.

Any helps or hints would be appreciated.
Thanks,

Upvotes: 2

Views: 631

Answers (3)

Jerry Coffin
Jerry Coffin

Reputation: 490108

If you're on a tight budget, and don't mind taking time to work around a fair number of limitations, Winlib is an option. If you're shorter on time, and have a larger budget, you might want to look into Mainsoft instead. It's not exactly perfect, but I believe it supports a considerably larger part of the Win32 API (at a correspondingly higher price).

Upvotes: 0

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798606

Winelib should let you compile Win32 code under Linux with only a few modifications.

Upvotes: 6

Mehrdad Afshari
Mehrdad Afshari

Reputation: 421978

Since your code base is in C, I'd suggest using GTK+. It's a cross platform GUI toolkit. For instance, Pidgin instant messenger GUI is created with GTK+. Glade user interface designer can be used to graphically design UIs.

Upvotes: 1

Related Questions