Articles tagged work-planet
The run-time search path (rpath) defines paths to search for dynamic libraries when executing a program. It is a mechanism on Linux parallel to the LD_LIBRARY_PATH environment variable, which is another hint to find dynamic libraries.
Usually, it is a good idea to make software which you built relocatable. This means that created binaries can be...Read more
If you are building multiple related software projects with a continuous integration server one important aspect is to be notified when changes in an upstream job break the build or tests for a downstream job. This involves knowing which exact build numbers of the upstream and the downstream job are involved.
The Jenkins continuous integration server...Read more
I am currently evaluating the applicability and limitations of the Jenkins continuous integration server for C++ development. Besides several limitations which are mainly caused by the complexity of C++, Jenkins provides a solid basis for continuous integration of C++ projects.
One thing which I was not happy with so far was the missing integration...Read more
Today I stumbled upon a very subtle problem with default arguments in python. I noticed that loading a python module already instantiated one of my classes even though I could not find an installation of this class. In the end it turned out to be a default argument for a function:
def foo(arg=MyClass()): pass
As I am currently programming...Read more
I've seen this several times causing troubles:
boost::shared_ptr<Foo> p(new Foo); boost::thread t(boost::bind(&Foo::method, p.get()))
This prevents the livecycle management of
shared_ptror any other smart pointer to be effective in the thread. Hence,
pmay get destructed even though the thread is still active.
Boost bind can handle smart...Read more
After switching my computers to Arch Linux, reusing the existing home directories, I had the problem that the bash did not replace the user's home directory with the tilde character (~) in the prompt. The solutions for this problem is easy: somewhere in the bash-internals a check tests whether the output of pwd matches the contents ofRead more
Compiling C and C++ code with the highest warning levels is a good practice and helps spotting potential errors. For GCC the flags
will generate a lot of useful warning messages about unused parameters etc.
Unfortunately, this is not the common practice and often the own compiler settings concerning the warning level results in...Read more
Just some quick thought on how to handle compiler warnings about unused parameters in C++ code. While these warnings are helpful most of the time, sometimes you simply have to ignore a parameter that is required by an interface definition. Then you got three solutions to remove the warning:
Change the compiler flags. The worst solution....
CMake doesn't provide a dedicated way to install header files (except for mac). What I wanted to do was to install all headers of my project using the same directory structure as in the source tree. This isn't as easy as it sounds. Assume you have a list of header files:
SET(HS folder/test.h folder/other/test2.h)
A simple call toRead more
googlemock is a framework that allows generating mock objects for unit tests. I've decided to use this framework as it looks wells designed and maintained. The default is to use googlemock with Google's unit testing framework googletest, but as I was already using the Boost Testing Library, I was searching for a solution to use googlemock in Boost...Read more
Since a long time I was wondering why CDT, the C++ support for the Eclipse IDE, doesn't have a decent support for highlighting and creating comments in the Doxygen format. Today, while searching for customizable code templates per project, I found the setting to enable Doxygen support. It is located in the project properties at "C/C++ General". Not...Read more
In der Java-Welt gibt es schon lange die sinnvolle Konvention kompilierte class-Dateien in einer anderen Verzeichnisstruktur abzulegen als den Quellcode. So eine eine Konvention hat viele Vorteile:
- Falls der Quellcode in ein Versionskontrollsystem eingecheckt wird (und das sollte er auf jeden Fall), müssen nicht umständliche Regeln zum Excluden...