C/C++ Language

May 5th, 2012

Contents

Common

C Language

C++ Language

C++ Language – C++11

STL

STL – Boost

Algorithms

Source

  • CCAN – nice snippets of C code should be moved out of junkcode directories and exposed to a wider world, where they can become something useful. CCAN is loosely modelled after the successful CPAN project for Perl code development and sharing.
  • sources.ru
  • The Code Project
  • Koders.com is a free on-line search engine for open source software and other web-downloadable code

Libraries

  • Crypto
    • Crypto++
    • Botan, a friendly C++ crypto library
    • Libecc is an elliptic curve crypto library for C++ developers. It is currently in development.
  • Win32 OpenSSL
  • The Better String Library
  • cstring – C-style string definition and manipulation library.
  • FastFormat – the best C++ output/formatting library you’ll ever use.
  • Trio – portable and extendable printf and string functions. Trio is a fully matured and stable set of printf and string functions designed be used by applications with focus on portability or with the need for additional features that are not supported by standard stdio implementation.
  • b64 – Base-64 Encoding Library (C library with C++ mapping; Platform-independent)
  • The MemSL for C and C++ - Includes a complete data structures/collection classes library, memory tracing, memory debugging, entry/exit tracing, exception handling, definable memory handlers, built-in threads support and much more.
  • Flux is a library of odds and ends related to data storage and indexing, marshalling, transfer, compression and encryption. It also features a slew of utility functions for various purposes. It is written in C, using the GLib paradigm.
  • Regular Expression
    • PCRE – Perl Compatible Regular Expressions
  • GLib
  • DispHelper is a COM helper library that can be used in C++ or even plain C. No MFC or ATL required! It allows you to call COM objects with a printf style syntax. Included with DispHelper are over 20 samples demonstrating using COM objects from ADO to WMI.
  • Libsmbios is a cross-OS library intended to be used to obtain common information available in BIOS using a unified application programming interface (API). Currently, it can programmatically access any information in the SMBIOS tables. It also has the ability to obtain Dell system-specific information such as the Dell System ID number, service tag, and asset tag. Future plans include APIs for $PIR, and mptable mapping.
  • fuse-zip is a FUSE file system to navigate, extract, create and modify ZIP archives based in libzip implemented in C++. With fuse-zip you really can work with ZIP archives as real directories. Unlike KIO or Gnome VFS, it can be used in any application without modifications.
  • VOLE – A Neat C++ COM/Automation Driver. VOLE is an open-source C++ library that dramatically simplifies the business of driving COM servers (via the IDispatch interface) from C++.

Libraries – Command Line

  • CLAP is a C++ package that enables a programmer to define and parse command line arguments easily.
  • TCLAP is a small, flexible library that provides a simple interface for defining and accessing command line arguments. It was intially inspired by the user friendly CLAP libary. The difference is that this library is templatized, so the argument class is type independent. Type independence avoids identical-except-for-type objects, such as IntArg, FloatArg, and StringArg. While the library is not strictly compliant with the GNU or POSIX standards, it is close.

Libraries – Standard algorithms

Libraries – Compression

  • compression.ru – задачей сайта является сбор и публикация материалов в области сжатия данных. На сервере расположены фрагменты книги “Методы сжатия данных”, вышедшей в 2002 году, более 1030 статей по сжатию и исходные тексты более 50 компрессоров.
  • The Data Compression Information Source
  • LZHAM (LZ, Huffman, Arithmetic, Markov) is a general purpose lossless data compression library that borrows many ideas from LZMA but purposely makes several key tradeoffs that favor decompression speed over compression ratio. LZHAM’s compression ratio is currently approximately .5-1.5% less than LZMA, but decompresses approximately 2-3x faster on a Core i7.
  • zlib – a massively spiffy yet delicately unobtrusive compression library
  • LZO is a portable lossless data compression library written in ANSI C.
  • FreeArc is a modern general-purpose archiver. Main advantage of FreeArc is fast but efficient compression and rich set of features.

Libraries – Debug

  • memwatch – a memory leak detection tool. Basically, you add a header file to your souce code files, and compile with MEMWATCH defined or not. The header file MEMWATCH.H contains detailed instructions.

Libraries – SQL

  • SQLite
  • hiberlite – C++ Object-relational mapping for sqlite3. C++ object-relational mapping with API inspired by the Boost.Serialization – that means almost no API to learn. In contrast to most serialization libraries with SQL serializers, C++ objects mapped with hiberlite behave similar to active record pattern – you are not forced to follow the “read all your data/modify some small part/write everything back” path. For people who need reliable data storage, ACID transactions, simple random-access to their data files, and don’t like coding in SQL.
  • OTL – Oracle, ODBC and DB2-CLI Template Library. OTL 4.0 is a C++ library based on C++ templates.

Libraries – Logging

  • Pantheios is an Open Source C/C++ Diagnostic Logging API library, offering an optimal combination of 100% type-safety, efficiency, genericity and extensibility. It is simple to use and extend, highly-portable (platform and compiler-independent) and, best of all, it upholds the C tradition of you only pay for what you use.
  • CMCrashReporter is a free and open-source framework written in Cocoa which developers can stick in their applications to allow the user to easily send a crashlog back to the developer.
  • xTests is a simple, easy-to-use, efficient unit- and component-test library, for multiple languages. Combining high discoverability and low coupling, xTests is a lightweight solution designed for use in verifying other libraries.

Libraries – Multiplatform

  • LibU – is a multiplatform C library which comes under a BSD-style license. It includes many interdependent modules for accomplishing several tasks: memory allocation, networking and URI parsing (rfc2396), string manipulation, debugging and logging in a very compact way, plus many other miscellaneous tasks.
  • commonc++ is a C++ class library for developing cross-platform systems software for POSIX systems (GNU/Linux, Mac OS X, Solaris) and Windows (Visual Studio or GNU toolchain via MinGW). It provides C++ wrappers for common operating system facilities like threads, mutexes, semaphores, sockets, shared memory, regular expressions, filesystem access, etc., as well as abstractions for strings, buffers, object pools, timers, logging, and more.
  • dlib C++ library – is a general purpose cross-platform C++ library designed using contract programming and modern C++ techniques. It is open source software and licensed under the Boost Software License.
  • Openframeworks is a c++ library designed to assist the creative process by providing a simple and intuitive framework for experimentation. The library is designed to work as a general purpose glue, and wraps together several commonly used libraries under a tidy interface: openGL for graphics, rtAudio for audio input and output, freeType for fonts,freeImage for image input and output, quicktime for video playing and sequence grabbing.
  • UNIXem: UNIX Emulation Library for Win32
  • recls – recursive ls – the platform-independent recursive search library
  • shwild is a simple, platform-independent, library that implements shell-compatible wildcard pattern matching. It is implemented in C/C++, expressing a C-API, with a C++ wrapper
  • The ADAPTIVE Communication Environment (ACE)
  • Portable Dynamic Loader (PDL) project – C++ Portable Dynamic Loader A small and lightweight library for creating and using dynamically loaded classes in C++. Common interface works on both Windows and Unix/Linux platforms.
  • Apache Portable Runtime(APR)

Libraries – UI

  • wxWidgets is a C++ library that lets developers create applications for Windows, OS X, Linux and UNIX on 32-bit and 64-bit architectures as well as several mobile platforms including Windows Mobile, iPhone SDK and embedded GTK+.
  • Ultimate++ is a C++ cross-platform rapid application development framework
  • BCGSoft – Professional GUI for professional applications. BCGControlBar Professional is an MFC extension library that allows you to create the most advanced user interfaces in the world. It combines an easy to use and very powerful feature set implemented by highly customizable collection of MFC extension classes.
  • HTMLayout – fast, lightweight and embeddable HTML/CSS renderer and layout manager component. (HTMLayout Wiki)
  • GTK+. gtkmm is the official C++ interface for the popular GUI library GTK+

Libraries – Graphics

  • GraphicsMagick is the swiss army knife of image processing. Comprised of 282K physical lines (according to David A. Wheeler’s SLOCCount) of source code in the base package (or 952K including 3rd party libraries) it provides a robust and efficient collection of tools and libraries which support reading, writing, and manipulating an image in over 88 major formats including important formats like DPX, GIF, JPEG, JPEG-2000, PNG, PDF, PNM, and TIFF. Image processing may be multi-threaded using OpenMP so that CPU-bound tasks scale linearly as processor cores are added. OpenMP support requires compilation with GCC 4.2 (or later), or use of any C compiler supporting at least the OpenMP 2.0 specification.
  • ImageMagick is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats (over 100) including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, and TIFF. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bezier curves.
  • Clutter is an open source (LGPL 2.1) software library for creating fast, compelling, portable, and dynamic graphical user interfaces. It is a core part of MeeGo, and is supported by the open source community. Its development is sponsored by Intel.
  • OpenCV (Open Source Computer Vision) is a library of programming functions for real time computer vision. OpenCV шаг за шагом.
  • The CImg Library is a small, open source, C++ toolkit for image processing. (article: Краткое описание библиотеки CImg)

Libraries – Media

  • FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video. It includes libavcodec – the leading audio/video codec library.
  • MediaInfo supplies technical and tag information about a video or audio file. It is free software (free of charge and free access to source code: GPL or LGPL licence)
  • libVLC- you can embed libVLC into your application to gain audio/video playing features.
  • TagLib is a library for reading and editing the meta-data of several popular audio formats. Currently it supports both ID3v1 and ID3v2 for MP3 files, Ogg Vorbis comments and ID3 tags and Vorbis comments in FLAC, MPC, Speex, WavPack TrueAudio, WAV, AIFF, MP4 and ASF files.

Libraries – XML

  • Libxml2 is the XML C parser (Windows port)
  • Xerces-C++ is a validating XML parser written in a portable subset of C++. Xerces-C++ makes it easy to give your application the ability to read and write XML data. A shared library is provided for parsing, generating, manipulating, and validating XML documents using the DOM, SAX, and SAX2 APIs.
  • TinyXML is a simple, small, minimal, C++ XML parser that can be easily integrating into other programs. It reads XML and creates C++ objects representing the XML document. The objects can be manipulated, changed, and saved again as XML.
  • LibAxl (or just Axl) is an implementation of the XML 1.0 standard specification, developed by the ASPL people to support many of its XML software requirements.
  • RapidXml is an attempt to create the fastest XML parser possible, while retaining useability, portability and reasonable W3C compatibility. It is an in-situ parser written in modern C++, with parsing speed approaching that of strlen function executed on the same data.

Libraries – Parsers

  • libConfuse is a configuration file parser library, licensed under the terms of the ISC license, and written in C. It supports sections and (lists of) values (strings, integers, floats, booleans or other sections), as well as some other features (such as single/double-quoted strings, environment variable expansion, functions and nested include statements). It makes it very easy to add configuration file capability to a program using a simple API.
  • Open-RJ is an open-source library that implements readers of the Record-Jar structured text file format. It is implemented in C & C++, with a C-API. The implementation of the basic library is platform-independent. In addition to platform-independence, the library focuses on small runtime costs – memory and speed – and the classic UNIX attributes of discoverability and visibility.

Libraries – Network

  • libcurl – libcurl is a free and easy-to-use client-side URL transfer library, supporting DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET and TFTP. libcurl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, user+password authentication (Basic, Digest, NTLM, Negotiate, Kerberos), file transfer resume, http proxy tunneling and more!
  • libssh2 is a client-side C library implementing the SSH2 protocol
  • OMQ is a new layer in the networking stack, a scalability layer that spreads the load of a distributed system so that it can support arbitrarily large applications. OMQ defines the overall topology of the distributed system rather than simple point-to-point communication. 0MQ applications are concurrent without locks, and elastic over any number of threads, cores, and boxes.
  • Mongrel2 is an application, language, and network architecture agnostic web server that focuses on web applications using modern browser technologies.
  • GNU libmicrohttpd is a small C library that is supposed to make it easy to run an HTTP server as part of another application.
  • POCO – modern, powerful open source C++ class libraries and frameworks for building network- and internet-based applications that run on desktop, server and embedded systems.

Libraries – Web

  • CAS – C++ Application Server
  • The Chromium Embedded Framework (CEF) is an open source project to develop a Web browser control based on the Google Chromium project. The base framework includes C and C++ programming interfaces exposed via native libraries that insulate the host application from Chromium and WebKit implementation details. It provides close integration between the browser control and the host application including support for custom plugins, protocols, JavaScript objects and JavaScript extensions. The host application can optionally control resource loading, navigation, context menus, printing and more, while taking advantage of the same performance and HTML5 technologies available in the Google Chrome Web browser.
  • JSON (see “Useful Links“, “Web – data interaction” section)
    • cJSON – An ultra-lightweight, portable, single-file, simple-as-can-be ANSI-C compliant JSON parser, under MIT license.
    • jajl - Yet Another JSON Library. YAJL is a small event-driven (SAX-style) JSON parser written in ANSI C, and a small validating JSON generator. YAJL is released under the BSD license.

Libraries – Other

  • Shed Skin is an experimental compiler, that can translate pure, but implicitly statically typed Python programs into optimized C++. It can generate stand-alone programs or extension modules that can be imported and used in larger Python programs.
  • GUP –  is a Generic Updater running under Windows environment. The aim of GUP is to provide a ready to use and configurable updater which downloads a update package then installs it. By using cURL library and TinyXml module, GUP is capable to deal with http protocol and process XML data.
  • V8 JavaScript Engine.
  • PoDoFo is a library to work with the PDF file format. The name comes from the first letter of PDF (Portable Document Format). A few tools to work with PDF files are already included in the PoDoFo package.
  • libusb – a library that gives user level applications uniform access to USB devices across many different operating systems.
  • The OGR Simple Features Library is a C++ open source library (and commandline tools) providing read (and sometimes write) access to a variety of vector file formats including ESRI Shapefiles, S-57, SDTS, PostGIS, Oracle Spatial, and Mapinfo mid/mif and TAB formats.

Microsoft relating

TDD (Test-driven development)

  • Google C++ Testing Framework (googletest) – Google’s framework for writing C++ tests on a variety of platforms (Linux, Mac OS X, Windows, Cygwin, Windows CE, and Symbian). Based on the xUnit architecture. Supports automatic test discovery, a rich set of assertions, user-defined assertions, death tests, fatal and non-fatal failures, value- and type-parameterized tests, various options for running the tests, and XML test report generation.

Tools

  • CMake – the cross-platform, open-source build system
  • SCons is an Open Source software construction tool—that is, a next-generation build tool. Think of SCons as an improved, cross-platform substitute for the classic Make utility with integrated functionality similar to autoconf/automake and compiler caches such as ccache. In short, SCons is an easier, more reliable and faster way to build software.
  • Low Level Virtual Machine
  • Low Level Virtual Machine (LLVM)
  • Stunnix C++ Obfuscator is an advanced tool for making C and C++ source code difficult to understand and adapt. It’s useful for cases when source code needs to be shipped without fear of intellectual property theft or illegal code reuse.
  • CScout is a source code analyzer and refactoring browser for collections of C programs.

Tools – Unit Tests

  • UnitTest++ is a lightweight unit testing framework for C++. It was designed to do test-driven development on a wide variety of platforms. Simplicity, portability, speed, and small footprint are all very important aspects of UnitTest++. UnitTest++ is free software. The license is the same as the MIT/X Consortium license. UnitTest++ is ANSI portable C++ and makes minimal use of advanced library and languages features, which means it should be easily portable to just about any platform. Out of the box, the following platforms are supported: Win32, Linux, Mac OS X.

Tools – Profilers

  • Intel® VTune™ Performance Analyzer evaluates applications on all sizes of systems based on Intel® processors, from embedded systems through supercomputers, to help you improve application performance. VTune Performance Analyzer makes application performance tuning easier and is indispensable for making your software run its fastest on the latest single and multicore systems.
  • Valgrind is an award-winning instrumentation framework for building dynamic analysis tools. There are Valgrind tools that can automatically detect many memory management and threading bugs, and profile your programs in detail. You can also use Valgrind to build new tools. It runs on the following platforms: X86/Linux, AMD64/Linux, PPC32/Linux, PPC64/Linux, and X86/Darwin (Mac OS X).
  • OProfile is a system-wide profiler for Linux systems, capable of profiling all running code at low overhead. OProfile is released under the GNU GPL.
  • Coverity Prevent for C/C++ – optimize software integrity and decrease development time with the most precise static source code analysis solution available today. Coverity Prevent for C/C++ automatically identifies and helps resolve the most critical quality defects, security vulnerabilities and concurrency defects at the earliest stage in the software development cycle. It is the product of choice for developers who demand flexibility, maturity and accuracy in source code analysis. Prevent helps development teams ensure the integrity of the critical software code they deliver by automating the defect discovery process at the earliest stage of the production lifecycle.
  • Bullseye Coverage – quickly find untested C++ code and measure testing completeness.
  • OpenGrok is a fast and usable source code search and cross reference engine. It helps you search, cross-reference and navigate your source tree. It can understand various program file formats and version control histories like Mercurial, Git, SCCS, RCS, CVS, Subversion, Teamware, ClearCase, Perforce, Monotone and Bazaar. In other words it lets you grok (profoundly understand) the open source, hence the name OpenGrok. It is written in Java.
  • Klocwork – provides source code analysis tools that boost development productivity. Over 700 organizations use Klocwork‘s static analysis technology to identify security vulnerabilities and quality defects, optimize their peer code review process, and enable developers to create more maintainable code.

Tools – Code review

  • List of tools for static code analysis
  • Artistic Style - A Free, Fast and Small Automatic Formatter for C, C++, C#, and Java Source Code
  • Vera++ – Programmable verification and analysis tool for C++
  • Splint is a tool for statically checking C programs for security vulnerabilities and coding mistakes. With minimal effort, Splint can be used as a better lint. If additional effort is invested adding annotations to programs, Splint can perform stronger checking than can be done by any standard lint.

Tools – Code analysing

  • Cppcheck - is an static analysis tool for C/C++ code. Unlike C/C++ compilers and many other analysis tools it does not detect syntax errors in the code. Cppcheck primarily detects the types of bugs that the compilers normally do not detect. The goal is to detect only real errors in the code (i.e. have zero false positives).
  • Visual Lint is Riverblade’s solution for developers who require advanced static code analysis capabilities within the Microsoft Visual Studio and eMbedded Visual C++ integrated development environments.

IDE and Compilers

  • Low Level Virtual Machine (LLVM)
  • Comeau C++ Online
  • MinGW - a contraction of “Minimalist GNU for Windows”, is a port of the GNU Compiler Collection (GCC), and GNU Binutils, for use in the development of native Microsoft Windows applications.
  • MinGW-w64 – GCC for both x64 & x86 Windows!
  • lcc – a retargetable compiler for ANSI C
  • pcc –  the Portable C Compiler
  • TDM-GCC is a compiler suite for Windows. It combines the most recent stable release of the GCC toolset with the free and open-source MinGW or MinGW-w64 runtime APIs to create a LIBRE alternative to Microsoft’s compiler and platform SDK.
  • codepad is an online compiler/interpreter, and a simple collaboration tool
  • CINT is an interpreter for C and C++ code. It is useful e.g. for situations where rapid development is more important than execution time. Using an interpreter the compile and link cycle is dramatically reduced facilitating rapid development. CINT makes C/C++ programming enjoyable even for part-time programmers.
  • SDCC – Small Device C Compiler
  • Tiny C Compiler - You can compile and execute C code everywhere, for example on rescue disks (about 100KB for x86 TCC executable, including C preprocessor, C compiler, assembler and linker). Tcc generates x86 code. No byte code overhead. Compile, assemble and link several times faster than GCC. Any C dynamic library can be used directly. TCC is heading torward full ISOC99 compliance. TCC can of course compile itself. Tcc includes an optional memory and bound checker. Bound checked code can be mixed freely with standard code. Compile and execute C source directly. No linking or assembly necessary. Full C preprocessor and GNU-like assembler included. C script supported. With libtcc, you can use TCC as a backend for dynamic code generation.
  • Ch is an embeddable C/C++ interpreter for cross-platform scripting, shell programming, 2D/3D plotting, numerical computing, quick animation, and embedded scripting. Ch is a free and user-friendly alternative to C/C++ compilers for beginners to learn C/C++
  • EiC project - this is a resurrected open source C Interpreter project. The new release includes enhancements that allows the C Interpreter to talk to logic simulation so that it can be used to drive simulation. This project bridges Software and logic simulation.
  • C-Free is a professional C/C++ integrated development environment (IDE) that support multi-compilers. Use of this software, user can edit, build, run and debug programs freely.
  • Free C/C++ Compilers and Interpreters
  • Code::Blocks is a free C++ IDE built to meet the most demanding needs of its users.
  • VisualDDK – develop/debug drivers directly from VS
  • Eclipse

Tricks

Articles

Articles – C Language

  • C Finally Gets A New Standard. Tom Plum explores the new additions to C in a series of articles, starting with language-level atomic operations and thread primitives.

Articles – Presentations

Articles – Libraries – Graphics

Articles – Libraries – Network

Articles – Tools – CMake

Comments are closed.