You are viewing this site in administrative mode. Click here to view in regular mode.
print Short URL for this page:[close]

Press Ctrl+C to copy
bookmark feedback/comment

Reviews >>
C++ libraries
Sep 08, 2010


This section is meant to share with you the existence of, and promote the use of, certain open source and free C++ libraries. I will start with some of the better known libraries, and gradually talk about the less-known ones.

OpenCV

If you have anything to do with 2-D graphics, OpenCV is the answer. It's mostly a C library with not only excellent and fast graphics libraries, but also implementations of many state-of-the-art computer vision algorithms. It also has decent interfaces for hardware support (e.g. for cameras, etc). A big package, but even if you are concerned with the simplest graphics applications, OpenCV has it all and is very easy to use. Just Google it for some tutorials.

Ubuntu Linux users: Here is the instruction on how to get the library: https://help.ubuntu.com/community/OpenCV .

OpenGL

For fast, easy-to-use, yet feature-filled 3-D graphics, OpenGL is the answer. This is mostly a C library. But it is designed such that it is extremely convenient to use. It has an excellent concept of matrix stack implemented in it that makes transforming individual 3-D objects to transforming the whole scene very easy. If you are learning OpenGl, do not forget to take time to understand the glPushMatrix and glPopMatrix functions. Also, check out the utility tools (GLUT) that comes with lots of pre-defined functions to save your work.

While OpenGL will most likely work on any computer as long as the libraries are installed, in order to exploit hardware acceleration you may need to install some graphics drivers specific to your graphics card.

Ubuntu Linux users: You can use Synaptic package manager to install this library.

GltZPR

GltZPR is a handy little tool for easily adding mouse-driven rotation, zooming and panning of any OpenGL scene window. A single line in your code to initialize GltZPR is all that you'll need to make this work. There are a few little bugs in the library, but those are easily fixable. I absolutely recommend it!

GSL

The GNU Scientific Library is the ultimate place to find your mathematical tools. I have used its numerical integration and interpolation/fitting tools with excellent results. It's a highly developed and well-maintained C library. However if you are a C++ programmer, you may find that lack of C++ bindings make it a little cumbersome to use, which could possibly have been made much easier with some C++ bindings. However I believe for many of the functions that GSL provide, there is no other close competitor. So you can't possibly do away with GSL when it comes to your mathematical needs. However...

if you are looking for a linear algebra library to use in C++, GSL is probably not the best for you. In that case probably the answer for you is Armadillo (read next).

Ubuntu Linux users: You can use Synaptic package manager to install GSL.

Armadillo

Armadillo is a C++ library (rather a C++ binding on quite a few other libraries combined), that will serve almost all your linear algebra needs. Vectors, matrices, matrix inverse, decompositions, eigen-systems, etc. Armadillo can do it all! And above all, its pure C++ interface make it extremely easy to use. All the vector and matrix types have the standard operators overloaded, hence the expressions become very natural and easy to read when you write the matrix equations/expressions.

Ubuntu Linux users: You can use Synaptic package manager to install Armadillo library.

YAML-Cpp

YAML is a popular alternative to XML. It is much easier to write and read than XML, occupies much less space for the same information in XML format, yet has almost the equivalent features/abilities. So if you plan to read an user-provided configuration file or environment file in your program, you should probably go for YAML formats. And YAML-Cpp is there to help you parse YAML documents as well as write them with a lot of ease. Parsing and reading values from a YAML document using the YAML-Cpp library is a matter of few lines of code.

Ubuntu Linux users: You will need to manually download the YAML-Cpp library from Google codes and install it.

muParser

If YAML interested you, this library may also be of use to you. muParser lets you parse string expressions and evaluate them in a fast and efficient way. Thus, if, for example, you let the user of your application enter mathematical expressions (probably involving symbolic variables) in the fields of the YAML configuration files, you may use muParser to parse them. Do read the documentation carefully to understand how to make it work most efficiently for your application.

Ubuntu Linux users: You will need to manually download the muParser library and install it.


Cpp Research Programming OpenSource

Page last modified on November 18, 2012, at 12:10 AM EST.
(cc) Subhrajit Bhattacharya