mingw

tutorial: include-what-you-use for a cmake/mingw-build on win

Written by  on August 5, 2020

tl;dr:
0. Get the latest prebuilt version for Win: version 0.8 (3 years old :/)
1. Put this somewhere into you CMakeLists.txt
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE "C:\\include-what-you-use\\bin\\include-what-you-use.exe")
2. Enjoy the overflowing build-output for your legacy-project.

Read more…

Qt: Error: Not a signal or slot declaration

Written by  on September 4, 2019

This error is too ‘good’ to be just put into “Today I learned”.

While adapting some unit-testing-code for one of the classes, I received from minGW a error stating:

What is the problem? The member-declaration looked totally valid.
Until I realized I had removed the (now commented) “private”-statement and therefore the pointers were seen by the MOC as signals/slots. Which they weren’t!

Shame on me :’)

C++: proper init for double/float and the proper check

Written by  on May 9, 2019

Problem was that I initialized some doubles with 0.0 and then hoped that the imported values are assigned, which does not happen always. So a check was needed. But checking if(0.0 == x) is a really bad idea. MinGW will tell you too (as other compilers).
So I was searching for a proper way to check against 0.0. And then I found a better idea: initialize with NaN and use the standard-check against this. Much better!

(addendum: I know, a variant would be the best to fix the given task.)