English [en]

GNU [u]Common C++


GNU Common C++ is a class framework that was specifically designed for telephony applications. The original library was refactored into a different codebase which is better suited for embedded applications, GNU uCommon C++ (uCommon for short). The uCommon library, as currently packaged, also includes the original Common C++ class framework for legacy application support. All development of Common C++ now happens as part of uCommon, but we will continue to fix bugs in the original Common C++ codebase, which has long been considered stable.

General description

GNU uCommon and the original GNU Common C++ are both lightweight, portable and highly optimized class frameworks for writing C++ applications that need to use threads and support concurrent synchronization, and that use sockets, XML parsing, serialization, config files, thread-optimized string and data structure classes, etc.

Either framework offers a class foundation that hides platform differences from your C++ application so that you need not write platform-specific code. uCommon has been ported to compile natively on most platforms which support either POSIX threads, or may be used with Debian-hosted mingw32 and mingw64 to build native threading applications for Microsoft Windows users.

These frameworks are used to construct application services like GNU Bayonne, with additional libraries such as the GNU Common C++ RTP Stack and the GNU ccScript engine. Other related libraries include the standalone GNU ccAudio2 framework.

Special features of GNU uCommon

GNU uCommon is meant as a very light-weight C++ library to facilitate using C++ design patterns even for very deeply embedded applications, such as for systems using uClibc along with POSIX threading support. For this reason, uCommon disables language features that consume memory or introduce runtime overhead, such as RTTI and exception handling, and assumes one will mostly be linking applications with other pure C-based libraries rather than using the overhead of the standard C++ library and other similar class frameworks.

UCommon introduces some Objective-C-based design patterns, such as reference-counted objects, memory pools and smart pointers, and offers dynamic typing through very light use of inline templates for pure type translation, which are then tied to concrete base classes to avoid template instantiation issues. C++ auto-variable automation is also used to enable deletion of referenced objects and release of threading locks when methods return, without requiring one to explicitly code for these things.

This library depends on, and when necessary will introduce, some portable C replacement functions, especially for sockets, such as adding getaddrinfo for platforms which do not have it, or when threadsafe versions of existing C library functions are needed. Basic socket support for connecting to named destinations and multicast addresses, and binding to interfaces with IPV4 and IPV6 addresses is directly supported. Support for high-resolution timing and POSIX realtime clocks are also used when available.

While uCommon has been influenced by Common C++, it introduces some new concepts for handling thread locking and synchronization. It also builds all higher-level thread synchronization objects directly from conditionals. Hence, on platforms which, for example, do not have reader-writer locks (rwlocks), barriers, or semaphores, these are still found in uCommon. A common and consistent call methodology is used for all locks, whether mutex, rw, or semaphore, based on whether used for exclusive or “shared“ locking.

UCommon requires some knowledge of compiler switches and options to disable language features, the C++ runtime and stdlibs, and associated C++ headers. The current version supports compiling with GCC, which is commonly found on GNU/Linux, OS X, BSD-based systems, and many other platforms; and the Sun Workshop compiler, which is offered as an example of how to adapt uCommon for additional compilers. UCommon may also be built with GCC cross-compiling for mingw32 for Microsoft Windows targets, using the Redhat w32 pthread library.

The minimum platform support for uCommon is a modern and working POSIX pthread threading library. uCommon does not support other non-POSIX threading models such as Microsoft Windows threads or non-preemtive threading libraries like GNU Pth, so that we could optimize development efforts around POSIX pthread exclusively. I further use a subset of POSIX threads to assure wider portability by avoiding more specialized features like process-shared synchronization objects, pthread rwlocks and pthread semaphores, as these are not implemented on all platforms that I have found.


[2017] – The latest release of GNU uCommon is 7.0.0.

[2014] – The current release set, 6.1.0, of GNU uCommon is considered stable. This release corrected a long-standing issue with default exception models and completed legacy support. There are no immediate plans to introduce further features into the legacy library, though we may make changes to improve performance and/or support additional target platforms. There had been some separate work on a new version of the Serial I/O classes, and this may also get migrated into a future release.

[2010] – Current goals for GNU uCommon are in clarifying object naming and the current ABI.

[2007] – The first three releases of GNU uCommon were introduced in 1999-2000 as a pure “C” library for embedded targets, and had not seen an update in 7 years. Hence I have had the package name in use for a very long time. Work on what became GNU uCommon C++ 0.4 was originally intended as a refactoring effort for GNU Common C++ to better support IPV6, and became something different as entirely new code was written in 2006. I originally hoped to release uCommon in March of 2007 as a new package under the GNU GPLv3, but the license was unavoidably delayed. I may use uCommon to offer guidelines and code for further improving GNU Common C++ releases, I may merge the two packages, or I may make GNU Common C++ an extension library for uCommon. This has not been decided yet.


GNU Common C++ and uCommon may be found at ftp.gnu.org or one of its mirrors. Please use a nearby mirror if you can.


GNU Common C++ "2" and uCommon 1.* releases are licensed under the GNU General Public License, Version 2 or later, with runtime exception. Since release 2.0, GNU uCommon has been licensed under the GNU Lesser General Public License, Version 3 or later.


Reference manuals

Class documentation can be generated from sources by Doxygen. Several versions are also available online:

RPM and Debian documentation packages are also available for several versions of uCommon and Common C++ 2 (search for “ucommon-doc” or “commoncpp2-doc”).

User manuals

Support and Other Resources

The source code repositories can be accessed anonymously through the GNU Commoncpp project at Savannah.

The Common C++ mailing list is <bug-commoncpp@gnu.org>. It has a web interface for subscribing, modifying subscription options and searching the list archives. Feel free to send any bug reports, patches, and questions to this list.

To simplify management and bug tracking for the different packages I currently maintain, I have consolidated management of GNU Common C++, related GNU Common C++ packages, and GNU Telephony projects including GNU Bayonne and GNU SIP Witch. These are being managed through the GNU Telephone subsystem.

The following projects are known to use (or have used) GNU [u]Common C++:

Contact information

The current maintainer for this package is <dyfet at gnu dot org>.

Info about GNU uCommon and GNU Common C++ was retrieved from the Wayback Machine archive of the GNU Telephony website (licensed under the Free Documentation License 1.3), and included into the existing page.


 [FSF logo] “The Free Software Foundation (FSF) is a nonprofit with a worldwide mission to promote computer user freedom. We defend the rights of all software users.”

The Free Software Foundation is the principal organizational sponsor of the GNU Operating System. Support GNU and the FSF by buying manuals and gear, joining the FSF as an associate member, or making a donation, either directly to the FSF or via Flattr.