Cross Platform C library for GUI Apps?

CUser InterfaceQtGraphicsCross Platform

C Problem Overview


Free of charge, simple to learn/use, Cross Platform C library for GUI Apps? Am I looking for Qt?

Bonus question: Can I develop with the said library/toolkit on Mac then recompile on PC/Linux?

Super Bonus Question: Link to tutorial and/or download of said library.

The truth is that I'm in the process of catching up on the C family (coming from web development - XHTML/PHP/MySQL) to learn iPhone development.

I do understand that C is not C++ or ObjectiveC but I want to keep the learning curve as simple as possible. Not to get too off topic, but I am also on the lookout for good starter books and websites. I've found this so far.

I'm trying to kill many birds with one stone here. I don understand that there are platform specific extensions, but I will try to avoid those for porting purposes The idea is that I want to write the code on one machine and just compile thrice. (Mac/Win/Linux) If Objective C will compile on Windows and Linux as well as OS X then that's good. If I must use C++, that's also fine.

C Solutions


Solution 1 - C

If you are looking for a C++ library, then Qt basically does what you are looking for. If you want to stick to pure C, then Qt is not an option.

As a C framework you could use GTK+, it works on Linux, Windows and OS X.

Solution 2 - C

Take a look at the IUP Toolkit. It is written largely in C, and is also easily bound to Lua.

Solution 3 - C

To complete this post Allegro has to be here =)

http://www.talula.demon.co.uk/allegro/ Allegro Game Library, have many graphics functions and a basic GUI library

And an explicit gui (and very simple) Allegro based library

http://cgui.sourceforge.net/index.html

Both multi-platform

Solution 4 - C

Another option is Tk, which is a GUI library written in C. It comes with Tcl, a scripting language also written in C. These were designed from the ground up to be embedded in C programs.

Solution 5 - C

One that I have considered using was the EFL, as it's quite fast, simple, small, but powerful. I would recommend diving into Elementary, their simplest GUI toolkit, and then later on, once you get comfortable with it, move to EDJE, which is not as simple, but much more powerful.

Solution 6 - C

Qt is a C++ library. Other cross platform libraries that you might consider are wxWidgets (C++), and GTK (C).

All three of the presented libraries are fully cross platform. You can also look at Tcl/Tk, but that's a toolkit :).

Solution 7 - C

You tagged this question about [tag:qt], which is a tag I follow. However, you are also asking with regards to [tag:c] programming.

If for some strange (or domain-enforced) reason you feel you must use C and not C++, then Qt is not for you. It was designed from the ground-up as a C++ library.

Yet I'd strongly suggest questioning why your project would need to be in C. There are many benefits to C++, and the idea that C performs intrinsically better is mostly a myth. For some hard data on that, check out Bjarne Stroustrup's http://www2.research.att.com/~bs/new_learning.pdf">Learning C++ as a New Language.

If you must stick to C then there's always GTK. The underlying API of http://en.wikipedia.org/wiki/GTK%2B">GTK+</a> is C, but bindings also exist for C++ called http://en.wikipedia.org/wiki/Gtkmm">GTKmm</a>;. I'm not a big fan of it from a design perspective, but historically powered the Gnome desktop (Ubuntu's default)...and Google chose it for their version of Chrome for Linux. So it has some cred and support there.

But do note that Ubuntu is choosing Qt5 to implement their next version of "Unity" in the desktop:

https://askubuntu.com/questions/281092/why-is-canonical-choosing-qt-over-gtk-for-unitys-next-generation


EDIT: You added:

> If I must use C++, that's also fine.

"Must" is a strong word, but there is practically no comparison between C++/Qt vs. C/GTK. And the latter is becoming a thing of history.

Solution 8 - C

Take a look at the Ecere SDK. It offers a cross-platform GUI toolkit, and gives you eC, an object-oriented language derived from C (with all of its functionality) that is just great for building GUIs.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMosheView Question on Stackoverflow
Solution 1 - CsthView Answer on Stackoverflow
Solution 2 - CRBerteigView Answer on Stackoverflow
Solution 3 - CHernán EcheView Answer on Stackoverflow
Solution 4 - CBryan OakleyView Answer on Stackoverflow
Solution 5 - CMiJynView Answer on Stackoverflow
Solution 6 - CKornel KisielewiczView Answer on Stackoverflow
Solution 7 - CHostileFork says dont trust SEView Answer on Stackoverflow
Solution 8 - CJeromeView Answer on Stackoverflow