Cross-Platform Abstraction Libraries
Programming an application that can run both on UNIX and on Windows 32-bit (and optionally other platforms) can be very hard because of the fact that the APIs of those platforms are substantially different. Luckily, there are abstraction libraries with which a programmer can maintain a very similar code, while focusing on writing the application itself.
I will focus here on such libraries for C and C++. Higher level languages such as Perl, Python or Ruby usually provide an abstraction for such things within the language.
Table of Contents
Data Structures
-
GLib - an ANSI C library that provides many useful classes. It is complete, but sometimes common useful programming practices (such as supplying a callback context argument) are ignored. It also tends to have non-optimized code. LGPLed.
-
Kazlib - Provides a Red-Black tree, a hash table and a linked list manager. An Open-Source License.
-
The C++ Standard Template Library - Provides abstractions for many common data structures.
-
The libavl Homepage - Contains links to many implementations of balanced binary trees.
-
C2Lib - Library of Basics for C that contains a pool allocator, a Perl-like vector , hashes, Perl-like strings, and matrix and vector functions. LGPLed.
-
QtCore - part of Qt that provides data structures and system services (and not GUI). LGPLed starting from version 4.5. Previously licensed under either the GPL or a commercial licence.
System-Services Abstractions
-
The Apache Portable Run-Time - contains portable abstractions for many things, from memory allocation to threads. Apache Group License.
-
ACE - The Adaptive Communication Environment - a very comprehensive C++ library that provides portable abstractions for almost anything a system gives you except GUI. Runs on UNIX, Win32 and many embedded operating-systems.
-
ZThreads - a C++ library that abstracts UNIX and Win32 threads. LGPL.
-
POSIX Threads for Win32 - an implementation of the POSIX threads (pthreads) API for Win32. LGPL.
-
RogueWave's SourcePro Core - a commercial library that supplies C++ abstractions for many system services.
-
wxBase - a subset of the wxWidgets library that can be used for multi-threading and the such. C++ and LGPLed.
-
The Netscape Portable Runtime (NSPR) - an ANSI C library that abstracts Threads, sockets, files, data structures and many other goodies. Licensed under a triple GPL, LGPL and MPL licensing.
-
Boost - a free portable collection of C++ libraries that work well with the C++ Standard Library. Contains abstractions for data-structures and algorithms, parsing and I/O and sockets.
-
C++ Portable Components - cover functionality like threads, thread synchronization, filesystem access, streams, shared libraries and class loading, sockets and network protocols (HTTP, FTP, SMTP, etc.), including an HTTP server, as well as an XML parser with SAX2 and DOM interfaces.
-
QtCore - part of Qt that provides data structures and system services (and not GUI). LGPLed starting from version 4.5. Previously licensed under either the GPL or a commercial licence.
Graphical User-Interface
-
wxWidgets (formerly wxWindows) - a C++ cross-platform GUI library with Win32 , X-Windows and Mac OS X back-ends. LGPLed.
-
Qt - a C++ cross-platform GUI library with Win32, X-Windows and Mac OS X backends. A very encompassing API. LGPLed starting from version 4.5. Previously licensed under either the GPL or a commercial licence.
-
Mozilla's XUL - a C++ cross-platform GUI library for X-Windows, Win32 and MacOS based on XML. Triply Licensed under the MPL, LGPL and GPL.
-
Borland's VCL - The GUI library behind Delphi and C++ Builder. Proprietary License, which is free for use for developing Open-Source Programs. Note: Linux version no longer up-to-date or supported.
-
The FOX Toolkit - a C++ toolkit that runs on UNIX, Windows and MacOS X. Renders its own controls, so does not have the system-wide native look and feel, but OTOH has a consistent one across all platforms.
-
A comprehensive lists of GUI libraries for X-Windows (and perhaps other systems)
Multimedia
-
SDL - The Simple DirectMedia Layer - a comprehensive library that runs on Win32, BeOS and MacOS and several flavours of UNIX. Has bindings to many other languages
-
OpenGL - a portable library for 3-D and 2-D graphics, that provides many graphics primitives. Has an open-source LGPLed implementation titled Mesa.
-
Crystal Space - a portable library for managing a large number of objects in a three-dimensional world.
-
Open Inventor - A library for managing objects and manipulators in 3-D Space. LGPL. Runs on Windows, Linux and IRIX.
-
OpenAL - a library for generating three-dimensional sound. LGPLed.
-
PLib - a suite of portable game libraries. LGPLed.
-
ClanLib - a portable C++ game SDK. LGPLed.
Database Access
-
ODBC, and unixODBC - a portable, but rather heavyweight database abstraction layer for C.
-
libgda - a database abstraction library from the GNOME people.