A brief and hopefully to the point on getting up and running with OpenGL in an Ubuntu Linux environment. For setting up OpenGL in Windows / Visual Studio environments, please see this post. My choice of integrated development environment for C++ development for this example is Netbeans 7.3. Continue reading
Category Archives: C, C++
Practical examples of using Boost serialization
Listing1: Serialization of STL containers: a std::vector example using text archives
Your intuition may tell you to iterate through the STL container in order to serialize it, but it’s actually a lot simpler. First of all, be sure to include the necessary vector.hpp include file:
Continue reading
Getting started with SWiG for interfacing between C# and C++ Visual Studio projects
1. Download and extract the SWiG interface:
Windows version available here:
http://prdownloads.sourceforge.net/swig/swigwin-2.0.9.zip
Using Win32 static libraries in Visual Studio projects
A static library is simply a file that contains functionality that can be made available to other programs. Static libraries end with the .lib extension and are made available to other Visual Studio projects (console applications, MFC applications etc) by creating links to them. Please follow the steps described below in order to create and use your own static libraries.
Continue reading
How to recursively print STL-based trees
There are plenty of resources on how we may recursively search and print the contents of binary trees. This example shows how to (recursively) make use of the Boost serialization libraries and streams in order to print the contents of a tree-like data structure.
Continue reading
How to link DLLs to C++ Projects
These instructions, also available on the Microsoft site, show how to create from scratch a Visual Studio 2010 project that can utilize dll routines created elsewhere, by way of referencing. It basically says the same thing, but with additional screenshots to make it more intuitive.
Continue reading
Using stateful functors
For another example posts on functors (function objects) see here. A functor is an instance of a C++ class that has the operator() defined. One big advantage of functors is that when you define the operator() in C++ classes you not only get objects that can act like functions, but can also store state as well.
Continue reading
Using boost::bind to assign functions
Some code samples I have collated in the sample below, that demonstrate how boost::function can be assigned with functors, ordinary functions, class member functions and overloaded class member functions respectively.
Continue reading
Getting started with the Boost libraries in Cygwin
This post assumes that the boost libraries have been downloaded and extracted to the directory of your choice. See this previous posting for more details on how to download and extract the Boost libraries.
Continue reading
Using boost::bind as an improved means of calling member functions
This post takes a look at using boost::bind as a means of calling class
member functions in an efficient and generic way. It basically summarizes what has
already been said at Björn Karlsson’s excellent Informit article. Since I found the post useful, I thought it worth reproducing here, using the same status class but containing all the examples and approaches he describes in one program. Continue reading