C++ name demangling

Written by  on November 20, 2019

Like described in “Today I learned” (TIL): c++filt is quite helpful for demangling:

But what if you have none readily available? -> c++filtjs

Three ways to find the location of a certain DLL at Windows

Written by  on November 11, 2019

Common problem: just using the current working directory is not sufficient, because especially for unit-tests started from the Visual Studio-testrunner the opriginal, relative path is not fitting anymore. Fallback would be check an environment variable , which is set during installation or using the WinAPI (ugh).

versioned code can be found at: github/cppcCollection

Visual Studio 2015: error LINK1158 rc.exe not found

Written by  on October 22, 2019

Challenge: Visual Studio 2015, Windows Kit 8 and 10 installed, test application (as solution) for a SDK not buildable
Solution:
copy rc.exe and rcdll.dll from
C:\Program Files (x86)\Windows Kits\8.1\bin\x64
to
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin

SSH/SCP quick help

Written by  on October 17, 2019

Challenge was to reconfigure a device, which has a Linux running on a TQ-board. Some files had to be adjusted.

Connect to the device:

(Then enter password.)

List amount of free space:

Show target of symlink:

quick git stats

Written by  on October 11, 2019

(Another way without external tools.)

Visual Studio testrunner still running … and stopping you from accessing DLLs for linking

Written by  on October 8, 2019

Problem Challenge:
Several instances of vstest.executionengine.clr20.exe are still running, despite closing that nice Visual Studio 2015 and therefore the access to compile and link several DLLs with QtCreator is blocked.
Closing them one by one with the taskmanager is annoying.

Solution:
* CMD as admin
* $ taskkill /IM vstest.executionengine.clr20.exe /T /F
* or: $ wmic process where name=’vstest.executionengine.clr20.exe’ delete

QTest: increase the timeout duration for a test-case

Written by  on October 7, 2019

Set via environment variable QTEST_FUNCTION_TIMEOUT a higher timeout duration.
qputenv sets them temporary for the run of the single test case (put this at the beginning of the test case).

nota bene: This block has to be put before qExec is ran, so put it into the constructor of the test-suite!

Qt: libpng warning (exception) about wrong color profile (sRGB)

Written by  on October 1, 2019

Problem: libpng warning: iCCP: known incorrect sRGB profile

When debugging Qt applications which load some PNG as icons at startup, it could be annoying to continue with the debugger for each thrown exception.
So, let us fix them.

Invoking $ mogrify *.png in the icon directory will fix them.

How to get mogrify? Install imagemagick.
Either manually or on macOS via homebrew: $ brew install imagemagick

libPNG in version 1.6 has to be at least installed: $ convert -list format | grep PNG

How to force Win10 to use certain interface for “browsing”

Written by  on September 17, 2019

Problem was that before only two ethernet-interfaces were active. One for the company-intranet (which was gateway for internet) and the second one for some device connection.

After adding some 10 GigE-interface, somehow all DNS-requests were first routed via that interface. Which lead to a delay of 3-4 seconds for loading pages.

Can be fixed via setting a lower metrik to the interface, which influences the routing-table: “network- and sharing option > the specific adapter > “IPv4” > “Settings” > “Advanced settings” > bottom “metric” from “automatic metric” to some lower value. Usually it should be 25, I set 13.
You can check via CMD: $ route print for the current value. The used Gateway should have the lowest metric.

EFI partition on usb-stick: Win10 not able to remove it with the diskmanager

Written by  on September 5, 2019

Regular formatting/diskmanager can not handle it.
Additional tools were not available/allowed to install.

So the trick was to use “diskpart” (CMD ..):

  • then “list disk”
  • “select disk1” (or the one medium which contains the partition(s))
  • “clean”
  • confirm the error

Then use a regular tool to create a new partition.