Sunday, July 10, 2011

Cross-platform C++ libraries

Introduction
There are some cross-platform C++ libraries and some of them contain UI Frameworks.
I introduce these libraries and my experiences of them here.

Cross-platform C++ libraries with UI Frameworks
There are two cross-platform C++ libraries which have UI Frameworks as I know. Both of these two libraries are implemented based on adapter pattern.

Qt by Nokia
Qt (pronounced officially as cute /ˈkjuːt/, though often incorrectly as Q.T. /ˈkjuːˈtiː/) is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) (in which cases Qt is classified as a widget toolkit), and also used for developing non-GUI programs such as command-line tools and consoles for servers. Qt is most notably used in Autodesk Maya, Google Earth, KDE, Adobe Photoshop Elements, OPIE, Skype, VLC media player, VirtualBox, and Mathematica, and by the European Space Agency, Siemens, Volvo, Walt Disney Animation Studios, Samsung, Philips, and Panasonic. - from Wikipedia

Qt SDK combines the Qt framework with tools designed to streamline the creation of applications for Symbian and Maemo, MeeGo (Nokia N9) in addition to desktop platforms, such as Microsoft Windows, Mac OS X, and Linux.

I want to mention two most impressed things while I've been using Qt: One is well-designed architecture for cross-platform UI framework, the other is Qt Creator, powerful cross-platform integrated development environment, including UI designer tools and on-device debugging. I really like Qt Creator and recommend it even though it crashes sometimes :). If you are sick of slow response of MSVS or XCode, I'd like to advice you to have a chance of using Qt Creator. It really responses very quick and is easy to add source code files to project and to modify project setting. Qt Creator use gcc compiler by default with Mac and Linux, and MinGW with Windows but you can change it into MSVC compiler or Intel compiler.

Qt is available under GPL v3, LGPL v2 and a commercial license. Learn more about licenses here.

wxWidgets
wxWidgets (formerly wxWindows) is a widget toolkit for creating graphical user interfaces (GUIs) for cross-platform applications. wxWidgets enables a program's GUI code to compile and run on several computer platforms with minimal or no code changes. It covers systems such as Microsoft Windows, Mac OS X (Carbon and Cocoa), iOS (Cocoa Touch), Linux/Unix (X11, Motif, and GTK+), OpenVMS, OS/2 and AmigaOS. A version for embedded systems is under development.  - from Wikipedia

wxWidgets provides MFC like classes, thus it is a good option for C++ developers who are familier to MFC or WTL. But there are few things to know attentively. UI classes in wxWidgets are usually using self destruction when their windows are destroyed. If you use these UIs without having enough understanding of their self destruction mechanisms, it will bring serious problems such as abnormal termination by double deletion of the object. wxWidgets is still under development and upgrading. It's getting better as it's version is upgraded, but I am still experiencing some problems with Mac OS X such as unimplemented APIs or odd behaviors.

Cross-platform C++ libraries without UI classes
There are several cross-platform C++ libraries without UI functions and these libraries are widely used to develop server side applications. Usually these libraries are liter than GUI libraries.


POCO
The POCO C++ Libraries are a collection of open source class libraries for developing network-centric, portable applications in C++. POCO stands for POrtable COmponents. The libraries cover functionality such as threads, thread synchronization, file system access, streams, shared libraries and class loading, sockets and network protocols (HTTP, FTP, SMTP, etc.), and include an HTTP server, as well as an XML parser with SAX2 and DOM interfaces and SQL database access. The modular and efficient design and implementation makes the POCO C++ Libraries well suited for embedded development. - from Wikipedia


I applied POCO to my latest project and am very satisfying with it. The design of classes shows good hierarchy and it is well understandable. I could use its functionality without spending much time to read the document and all of my codes have been working correctly without fixing or modification. I can say that POCO is a very stabilized library just like STL, and a nice solution for cross-platform development. I want to thank POCO developers for making this nice open source library.

BOOST
The Boost C++ Libraries are a collection of free libraries that extend the functionality of C++.

No comments:

Post a Comment