Free C / C++ Libraries, Source Code and Frameworks
Reusable source code, libraries, components to link with your programs
Free C / C++ Libraries, Source Code and Frameworks
Here are some C and C++ libraries, DLLs, VCLs, source code, components, modules, application frameworks, class libraries, source code snippets, and the like, that you can use with your programs without payment of fees and royalties. Note that some libraries (etc) listed here may have certain restrictions about its use and/or distribution. Be sure you read the licence conditions in each package before using them.
A few types of libraries have been moved to their own pages, due to the large number of items in those categories. Here are some of the other pages containing free libraries on this site:
- SynEdit Multi-line Edit Control
SynEdit is a multi-line edit control that you can use in your Delphi and Borland C++ Builder programs. Features include syntax highlighting for a variety of programming languages and a macro recorder. This is a VCL control that comes with source code.
- Scintilla Edit Control
Ever wanted to create your own syntax-highlighting editor? Scintilla is a source code edit control, similar in concept to Microsoft's RichEdit control, that supports things like syntax highlighting, code completion and call tips. It also supports things like the use of proportional fonts, bold, italics, multiple foreground and background colours, and multiple fonts. The source code is available free, and the licence allows you to use the control in any project, free or commercial. You may also want to check out the Free Spell Checker Libraries, Source Code, Controls, Components to avoid reinventing the wheel.
- T1Lib - Adobe Type 1 Fonts Library
If you want your applications to support Adobe Type 1 fonts, this rasterizing library might be just what you need. It requires a Unix system. It is implemented independently of X11, so it might be the solution for those of you who don't want to use the Type 1 rasterizer provided with X11R5 and later. The source code for the package has a filename like t1lib-*.tar.gz (where * is replaced by the version number). Latest: There is a Windows port of t1lib available as well.
Heard of True Type? Well, now you can include True Type support in your programs on systems that do not have True Type support by default. Linux and other OSes are supported.
- STLport (STL Library)
This version of STL (Standard Template Library for C++) is available free of charge from their website. It is apparently also shipped with the current versions of the Borland / Turbo C++ compilers.
- SGI Standard Template Library (STL)
If your compiler does not have a recent Standard Template Library implementation, you might want to consider this version available free from SGI.
- LinuxThreads Library
The LinuxThreads library implements Posix 1003.1c threads on (as the name reveals) Linux. It provides kernel-level threads where scheduling is handled by the Linux kernel. Thus, unlike user-level thread packages, it can take advantage of multiprocessors.
- FSU Pthreads (POSIX Threads)
This C library implements POSIX threads on a variety of operating systems, including Linux, FreeBSD, SCO Unix, Solaris, SunOS and DOS.
(Since the original QpThread does not appear to be available any more, I'm listing this fork of QpThread.) The QpThread is a C++ framework for threads and Unix signals that operates on top of POSIX threads. It supports deferred cancellation (through C++ exceptions), timers, thread pools, etc.
- OpenCV: Open Source Computer Vision
OpenCV, or Open Source Computer Vision, is a library with functions for real time computer vision. It can be used in programs written in C, C++ and Python running on Windows, Linux, Mac OS X and Android. It has functions dealing with image processing, image transformations, detection and recognition, motion analysis and object tracking, segmentation, camera calibration and 3D reconstruction, matrix mathematics, histograms, drawing functions, etc. The library is licensed under the BSD licence.
- UpTools C++ Library
The UpTools C++ Library, from the Universidad De Palermo (ie, University of Palermo), is an open source C++ library with facilities for load distribution and parallel processing, multi-threading, timers, memory management (with smart pointers for objects in multithreaded environments), regular expressions, common interfaces for different databases, database access in a multithreaded environment, networking support (DNS, SSL, TLS, sockets, etc), and so on. The library appears to be written for Linux.
- Intel Threading Building Blocks for Open Source
The Intel Threading Building Blocks, or TBB, is a C++ threading library that abstracts platform details and threading mechanisms for your multi-threaded programs. Since it abstracts many details of thread management, it helps to reduce application complexity. The task manager handles load balancing among the processors, after automatically choosing the optimal number of processes for the system. The library is released under the GNU GPL version 2 with the runtime exception. Supported systems include Linux, Windows and Mac OS X.
- Boost C++ Libraries
This site is a source of "free peer-reviewed portable C++ source libraries" (quoted from the site). There are numerous libraries available, including libraries for managing date and time, filesystems, iterators, random numbers, regex, tests, strings, text processing, containers, math and numerics, data structures, memory, parsing, concurrent programming, algorithms, etc.
STLSoft is a collection of templates in header form that contain numerous classes and functions for Windows and Unix systems. Included in this library are ATLSTL (for creating COM components with the Active Template Library), COMSTL (allows the manipulation of the Component Object Model interfaces and API), .netSTL (applies STL techniques to the .NET framework), InetSTL (applies the STL techniques to the Internet APIs), MFCSTL (allows the manipulation of the Microsoft Foundation Classes or MFC), UNIXSTL (library for programming Unix-type systems), and WinSTL (allows you to program using the Windows API). The library comes with documentation and works with numerous compilers including Borland C++, Comeau C/C++, Digital Mars C/C++, GNU gcc, Intel C/C++, Metrowerks Codewarrior, Microsoft Visual C++, and OpenWatcom. As of version 1.8.1, STLSoft is licensed under the BSD license.
libunicows allows you to write programs that use Unicode on Windows 9x/ME with a compiler other than Microsoft Visual C++ (the Microsoft unicows library requires Visual C++). This library supports (at the time I write this) MinGW, Visual C++ 6, Borland C++, and the Watcom (and OpenWatcom) C/C++ compiler. It comes with source code released under the MIT licence.
OSLib is a C library for programmers writing system software (whether it be embedded software or even entire operating system kernels). It comprises 4 libraries (the extender library, the standard C library, the math library and the kernel library).
- MIT Exokernel Operating System
The MIT Exokernel Operating System attempts to provide a level of abstraction of hardware so that you can concentrate on the other aspects of implementing an operating system. It may be useful to those of you planning to write an operating system.
- The OSKit Project (Flux)
The OSKit Project is a C framework of 34 components providing a wide variety of facilities that is useful for people planning to write operating system kernels, servers, boot loaders, embedded applications and the like. The function libraries provide numerous facilities, including some common C library services (string, memory, printf, etc), default handlers for traps and interrupts, kernel support functions such as those that set up and manipulate page tables (etc), support for multiprocessor systems, POSIX emulation system call libraries, memory management, threads, synchronization, scheduling, debugging aids, hard disk handling, file system implementations, device driver implementations (SCSI, IDE, network drivers), video driver implementations, etc. The portions of OSKit that contain machine-dependent code currently supports Intel x86 and Digital DNARD (StrongArm SA-110 CPU).
glob is a parser to handle wildcards (similar to the way that Unix shells parse wildcards). It is released into the public domain (or so the site says). It is useful if you want to write a program with globbing facility but don't want to use the GPL ones that come from the Free Software Foundation. (The package is somewhere in the middle of the page linked to; just scroll down to find it.)
- libsigc++ Callback Framework for C++
libsigc++ has C++ classes that provide you a typesafe callback system. You can define signals and assign callback functions to those signals. It is licensed under the GNU Library General Public License (LGPL). It works on platforms with a standards-compliant C++ compiler, such as those with gcc (see the Free C/C++ Compilers page for gcc). A port for Microsoft Visual C++ (which does not implement partial specializating) has also been integrated into the distribution, so the library should also work with that compiler.
- The Standard Function Library
The Standard Function Library, or SFL, contains routines for compression, encryption, encoding, data type conversion, data output formatting, process control, dates, times, calendars, symbol tables, linked lists, configuration files, error message files, string manipulation, searching, Internet socket access, MIME, CGI, SMTP, batch programming, debug tracing, directory access, environment access, etc. It is designed with portability in mind. The library is written in ANSI C and is supported on MSDOS, Windows, OS/2, Linux, AIX, SunOS, HP/UX, Solaris, NetBSD, FreeBSD, SCO OpenServer, Digital Unix, and OpenVMS. The source code is also available.
- HTML Tidy Library Project
HTML Tidy is an HTML validation library that comes with source code. It allows you to embed HTML validation facilities into your application, which may come in handy if you are writing your own editor. (You may also be interested in the Free Spell Checker Libraries, Source Code, Controls, Components to avoid reinventing the wheel.)
- GNU Lightning
GNU Lightning is a library of routines that allows programs to generate assembly language code at runtime. It abstracts the target CPU, exposing your program to a standardized RISC instruction set. The library is supposed to be fast, thus making it useful if you're developing a Just-In-Time compiler.
- TurboPower Async Professional
If you need to add speech to your programs, or enable it to process speech input, TurboPower's Async Professional provides you an easy access to Microsoft's Speech API (SAPI) allowing you to integrate voice/speech recognition and speech synthesis in your programs. It also handles the sending and receiving (as well as viewing and printing) of faxes (and converts BMP, DCX, PCX and TIF files automatically), alphanumeric and text (GSM/SMS) paging, high speed file transfers (including the major file transfer protocols like Zmodem and FTP), IP telephony (audio and video, Voice Over IP or VOIP), Internet communications (Winsock access), supports ISDN modems, RS-232 and RS-485 standards, and includes an XML-based modem database. And so on. Like most of the TurboPower tools, this open source toolkit may be used with Delphi and Borland C++ Builder and ActiveX environments like Microsoft Visual C++ and Visual Basic. If you use Borland Kylix on Linux, a Pascal and Delphi-like compiler, you might want to try the TurboPower Async Professional CLX version.
- TurboPower SysTools
TurboPower SysTools contain numerous utility functions and classes for Borland Delphi and Borland C++ Builder as well as programming environments that support COM objects (like Microsoft Visual Basic, Microsoft Visual C++. Among the routines included in this library are string manipulation routines, date and time math routines, high-speed sorting, high-precision maths, runtime math expression analyzer, Microsoft Excel-like finance and statistical routines, email attachment MIME encoding and decoding, reusable containers (stacks, queues, trees, deques, hash tables), CRC data integrity checking, 1 dimensional and 2 dimensional (1-D and 2-D) bar codes, money routines, logging classes, patterns, random number distributions, text data manipulation and more. SysTools is open source, released by TurboPower under the Mozilla Public License. It works on Windows systems. There is also a version of TurboPower SysTools for Kylix.
- TurboPower Orpheus
TurboPower Orpheus contains over 120 VCL components such as data entry components, data entry validators, grid for presenting and editing 2 column information, status bars, progress bars, button and tab styles, reports, countdown and elapsed timer components, etc. Orpheus is open source, and may be used with development tools that support VCL such as Borland Delphi and C++Builder.
- TurboPower ShellShock
ShellShock contains native VCL components that allow your application to integrate with the Windows shell and Windows explorer. Included in this package are tree views, list views, combo boxes, enumeration of folder contents, monitoring of shell events, file operations (copy, delete, move, rename, together with Windows shell animations), drag and drop support, Windows shortcut creation and inspection, customization of common dialog boxes, minimization to the system tray, etc. You need to use a development tool that supports VCL such as Borland C++Builder and Delphi to use this toolkit. ShellShock comes with source code.
- TurboPower OnGuard
If you need to create demo versions of your programs, you might want to check out TurboPower's OnGuard library. The library provides you the ability to create applications that are time-limited, feature-limited, limited to a certain number of uses, limited to a certain number of concurrent network users, etc. Written in Object Pascal, it may be used in Windows development using tools like Borland C++Builder or Delphi.
- TurboPower Essentials
TurboPower Essentials has 13 open source native VCL components that provides drop-down calendars and calculators, roll-up dialog boxes, 3-D labels, tiled backgrounds, scrolling messages, menu buttons, etc. You need to use a development tool that supports VCL such as Borland C++Builder and Delphi to use this toolkit.
- TurboPower Visual PlanIt
Add time, task and contact management to your applications with Visual PlanIt's synchronized data-aware VCL components. You can create mult-column Outlook style contact grids; day, week, month event views, Outlook style task lists, connect-and-go database connectivity, printing, etc. The components are compatible with Delphi and C++Builder (and presumably any other development system that supports VCL components).
GetPot, an anagram of the ubiquitous getopt, allows programs to parse command lines and simple input files by simply including the header file for the library (the entire library is apparently in the header file). C++, Java, Ruby and Python versions are currently available. The library is distributed under the GNU LGPL.
MyLibC is a clone of glibc for Windows. The author wrote this to reduce the size of executables that resulted when glib was used on Windows. Sources are provided.
- uClibc - C Library for Embedded Systems
uClibc is a C library for developing embedded Linux systems. It supports shared libraries, multithreading and runs on standard Linux systems with support for ARM, i386, h8300, m68k, mips, mipsel, PowerPC, SH, SPARC, and v850 processors.
- GradC++ ToolBox
GradC++ ToolBox contains several C++ components dealing with threading, program options, logging, and initialisation of COBRA services. It comes with an administrative guide, programmers' guide and sources. The C++ library may be used free of charge for non-commercial purposes.
- IO95: Win95 LFN API Wrapper Library
This library has functions which you can call from your MSDOS programs to access the long filenames (LFN) API found in Windows 95 and above. It thus makes it easy for you to write long file name (LFN) support. The library contains the POSIX.1 compatible opendir() functions, DOS findfirst() functions, open() functions, fopen() functions, mk/rm/chdir(), remove(), unlink(), rename(), getcwd(), getdcwd(), getcurdir(), fullpath(), lfn2sfn(). As you can see, all the hard work of accessing the API has been done for you - just use the usual familiar functions (whether Unix or DOS). It requires a Borland compiler to compile (which you can get it for free, legally - check out the Free C/C++ Compilers page).
- ClibPDF PDF Library
ClibPDF is a C library that allows you to create PDF files from your application or even CGI scripts. With PDF files becoming more popular on the Internet, it is beginning to look like it may be a good idea for more applications to be able to create and access PDF files. The library is free if you are using it for non-profit purposes.
- Matrix TCL Lite
Matrix TCL Lite is a C++ matrix template class that may be used for common matrix operations like any other built-in data types. It has been tested with Borland C++ 5.0 (both 16 and 32 bit); Borland C++ 5.5, C++ Builder version 1.0, 3.0, 4.0 and 5.0; MS Visual C++ version 4.0, 4.2, 5.0 and 6.0; SUN g++ under Sun Solaris; GNU C++ and SGI C++ version 7.2.1; Metrowerks CodeWarrior Pro 5; and Sybase Power++ v 2.1.
Ensemble is a toolkit for building reliable distributed applications. Included in this toolkit is a library of protocols which you can use to build your distributed applications. The library primarily uses UDP/IP sockets. You can write your applications in C, C++, Java (on Solaris and NT), and ML. Ensemble itself is written in ML and will apparently run on any platform that supports Objective Caml and sockets, including Windows, SunOS4, Solaris, Linux and RS6000-AIX. You can get the binaries for SunOS, Solaris, Linux and Windows NT. Source code is also available for download.
This C library "allows network management applications to access SMI MIB module information through a well defined API that hides the nasty details of locating and parsing SMIv1/v2 MIB modules."
- Whisper C++ Application Framework
Whisper is a general purpose C++ application framework, which takes advantage of templates, multiple inheritance, STL and exceptions. It is portable to both Macintosh and Win32. It contains numerous debugging tools.
This is a CORBA 2 ORB (with associated libraries) that was originally developed by AT&T Laboratories, Cambridge, and is certified CORBA 2.1 compliant. OmniORB is distributed under the GNU GPL and the libraries in the package is distributed under the Library GPL. The package is designed in such a way so that you can actually distribute your applications that use the libraries without being forced to release your source code as well. Platforms supported include Solaris, Windows NT, Windows 95, Linux (x86, PowerPC), Digital Unix, AIX, HPUX, Open VMS (Alpha and Vax), NextStep, Reliant Unix, Phar Lap's Real Time ETS Kernel, SGI Irix, SCO Unixware, MacOS, OS RTEMS, SCO OpenServer, etc. In case you are wondering what CORBA is, it basically defines the interface and API that allows programs to communicate with each other even if they are running on separate machines on different hardware and operating systems. If you need more information, you can check up the Object Management Group's website for their beginner's guide.
- GNU Common C++
GNU Common C++ is a C++ framework for developing portable threaded applications. It has abstractions for threads, sockets, XML parsing, serialization, config files, and so on, hiding the differences between platforms in its classes so that you can write code that is (hopefully) portable. It is released under the GNU GPL license.
- Hoard malloc/free Replacement
Hoard is a malloc/free replacement that is supposed to be fast, scalable and memory efficient. It supports Linux and other Unix platforms. It is licensed under the GNU General Public License.
- Boehm-Demers-Weiser Garbage Collector
A garbage collector for C/C++ that can also function as a memory leak detector. You can simply replace your calls to malloc() with GC_malloc(). Win32, Win32s, OS/2, MacOS, AmigaDOS and Unix systems are supported.
Can't Find What You're Looking For?
Search the site using Google.
How to Link to This Page
It will appear on your page as: