At the end of October 2018 on the Qt development mailing list it was announced
that CMake was chosen as the build system (generator) for building Qt6. That also meant that The Qt Company will gradually stop
investing in their in house Qbs build system.

I personally think is a good idea to have major C++ projects like Boost (July 2017 switch announcement! ),
LLVM/Clang, and now Qt to use CMake as their build system (generator). We C++ developers should work together in having a common build system.

There was a bit of email traffic on this topic. There was some skepticism of CMake being able to support specialized operating systems
like QNX, so I pointed to an October 2017 blog entry of Doug Schaefer named QNX CMake Toolchain File.
There Doug Schaefer presents us with a minimal CMake Toolchain File.

Since I am lucky() to have a QNX 7.0 license I tried to compile and run the recently released CMake 3.13.0 for the QNX 7.0 x86_64 target!

At the beginning of this year Bits’n’Bites wrote an article named Faster C++ builds,
in which it’s being described how you can accelerate building LLVM using ninja, using a cache etc.

The following excerpt caught my eye:

For most developers, the time it takes to run CMake is not really an issue since you do it very seldom. However, you should be aware that for CI build slaves in particular, CMake can be a real bottleneck.

For instance, when doing a clean re-build of LLVM with a warm CCache, CMake takes roughly 50% of the total build time!

So I decided to build LLVM 4.0.0 (and clang) on my 2011 Core i7 Lenovo W510 laptop and see if I can reproduce his findings.

It is common for IT companies (at least in Germany, automotive field) to use Ubuntu Linux LTS
in a VirtualBox on Windows or Mac hosts. This way the employee can use Microsoft Outlook / Office,
Microsoft Skype, Cisco Spark, or other proprietary collaboration tools, and at the same
time use the supplied virtual machine for development.

By default VirtualBox doesn’t configure any 3D acceleration or multi-core CPU for the guest.
One needs to change these settings in order to have a more responsive desktop environment
and to compile faster Also important not to forget about the installation of the VirtualBox
Guest Additions.

Running glxinfo on a Ubuntu Linux 16.04 LTS in VirtualBox 5.1.18 gives back this information:

For those familiar with languages like Java, and C#, something like NullPointerException
shouldn’t come as a surprise. But what about C++? C++ also has exceptions, right?

In C++ reading or writing at address zero is an access violation. By default an access
violation will result in the immediate termination of the program. What else results
in immediate termination of the program? Division by zero! There is no ArithmeticException, only
a swift termination!

The OS’ SDK usually provides a way to catch such access violations and recover from them.
This way of catching access violations involves a C callback method and a bit of setup.

Wouldn’t be nice if the setup would be one line of code and the C callback function
would throw C++ exceptions behind the scenes?

But it does work like this. At least on Windows and Linux (I don’t have access to a macOS machine),
and only with a few select compilers.

Before going further into details I would like to present my test case: define functions which do:

Division by zero

Reading from nullptr

Writing at nullptr

Write to an empy vector with the subscript operator []

Read from an uninitialized shared_ptr

Execute them ten times to make sure that this is not only one time “wonder”. Every try block will
have an instance of a RAII Message object to make sure that stack unwinding is taking place, and
that we won’t have any resource leaks.

On Windows Qt Creator will output this information in Windows debugger output. I use DebugView
to view this information.

libclang is used by Qt Creator to provide code completion support. The clang code model is still experimental and not 100% feature equivalent with
the Qt Creator built-in code model.

By using the clang code model it means that Qt Creator uses a real C++ compiler to parse the source code you are editing. It also means
that if you are having a big source file, with lots of includes, it will take some time to do so.

Qt Creator will cache this information in a form of a pch file under %temp%/qtc-clang-[some letters]/preamble-[some numbers].pch file. The complete
compilation is done only once. The subsequent code completion commands are fast.

I will take clang 3.6.2 and compile it Visual C++ 2013, Visual C++ 2015, Clang 3.7.0 and Mingw-w64 GCC 5.3.0. I have managed to get libclang to
compile Text3.cpp in approximatively 6 seconds. Which C++ compiler was able to this?

In this article I will have a look on how to get started with Google Test libraries on
Windows using Qt Creator for both MinGW and Visual C++.

I used the plural for Google Test libraries because there is Google Test – Google’s C++
test framework and also Google Mock – Google’s C++ mocking framework. They both are
hosted on a single location on github.

Unfortunately the 2015 migration from Google Code to Github broke a lot of documentation
search page links for Google Test, not to mention that the code snippets lost the
syntax highlighting.

Having moved my blog to a static blogging engine means that now I have to upload the
generated blog html files to on a server. Octopress recommends deoploying using Rsync via SSH.

Since I do my hacking on a Windows machine and I use Total Commander for file management
I thought I would give Total Commander’s SFTP plugin a try.

I like to think that I am power user when it comes to Total Commander, but I ended up
installing WinSCP to upload the files via SSH. I couldn’t figure out the right combination
of DLL dependencies that Total Commander’s SFTP plugin requires.

A: Unfortunately we cannot support any encryption in Total Commander because of the current patent and crypto export situation.However, there is now a new file system plugin for Total Commander, which supports SFTP. SFTP is FTP via SSH. It needs SSH2, which is now supported by almost all new Linux and other Unix distributions.

Since my blog is hosted in Germany, and Germany doesn’t have a crypto export situation, I thought of
building the Total Commander’s SFTP plugin together with its dependencies.

Octopress is advertised as “a blogging framework for hackers”. As a hacker one “should be comfortable running shell
commands and familiar with the basics of Git”. But it all comes down to ruby.

If you’re a Windows hacker what do you do? My first idea was to install Cygwin.

For tastatura.info I’ve used Cygwin to run Octopress. I had a laptop with an Intel Core i7 CPU, didn’t notice any slowdowns.

By the time I’ve moved this blog to Octopress I didn’t have access to that Intel Core i7 powered laptop, but instead I had an Intel
Core 2 Duo powered laptop. Then I’ve noticed that Octopress was rather slow on Cygwin.