Unable to specify the compiler with CMake

Never try to set the compiler in the CMakeLists.txt file. See the CMake FAQ about how to use a different compiler: https://gitlab.kitware.com/cmake/community/wikis/FAQ#how-do-i-use-a-different-compiler (Note that you are attempting method #3 and the FAQ says “(avoid)”…) We recommend avoiding the “in the CMakeLists” technique because there are problems with it when a different compiler was used for … Read more

How do I write to standard error in PowerShell?

Use Write-Error to write to stderr. To redirect stderr to file use: Write-Error “oops” 2> /temp/err.msg or exe_that_writes_to_stderr.exe bogus_arg 2> /temp/err.msg Note that PowerShell writes errors as error records. If you want to avoid the verbose output of the error records, you could write out the error info yourself like so: PS> Write-Error “oops” -ev … Read more

C++ Compare char array with string

Use strcmp() to compare the contents of strings: if (strcmp(var1, “dev”) == 0) { } Explanation: in C, a string is a pointer to a memory location which contains bytes. Comparing a char* to a char* using the equality operator won’t work as expected, because you are comparing the memory locations of the strings rather … Read more

VBA collection: list of keys

If you intend to use the default VB6 Collection, then the easiest you can do is: col1.add array(“first key”, “first string”), “first key” col1.add array(“second key”, “second string”), “second key” col1.add array(“third key”, “third string”), “third key” Then you can list all values: Dim i As Variant For Each i In col1 Debug.Print i(1) Next … Read more

Linux PID recycling [closed]

As new processes fork in, PIDs will increase to a system-dependent limit and then wrap around. The kernel will not reuse a PID before this wrap-around happens. The limit (maximum number of pids) is /proc/sys/kernel/pid_max. The manual says: /proc/sys/kernel/pid_max (since Linux 2.5.34) This file specifies the value at which PIDs wrap around (i.e., the value … Read more