Author Archives: dmitriano

Configuring SFTP access with Visual Studio Code

I installed SFTP extension:

(more…)

Building QT6.4 for MacOS with Ninja generator

In the same SSH session where I built QT6.4 for MacOS with Unix Makefiles generator I installed ninja:

brew upgrade
Running `brew update --preinstall`...
==> Downloading https://ghcr.io/v2/homebrew/portable-ruby/portable-ruby/blobs/sha256:1f50bf80583bd436c9542d4fa5ad47df0ef0f0bea22ae710c4f04c42d7560bca
######################################################################################################################################################################## 100.0%
==> Pouring portable-ruby-2.6.8_1.el_capitan.bottle.tar.gz
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
...
(more…)

Building QT6.4 for MacOS with Unix Makefiles generator

On the same machine where I Built QT 6.2.2 for MacOS I opened SSH session and set the locale:

export LC_ALL=en_US.UTF-8  
export LANG=en_US.UTF-8

checked the locale has been set correctly:

locale

it printed the following:

LANG="en_US.UTF-8"  
LC_COLLATE="en_US.UTF-8"  
LC_CTYPE="en_US.UTF-8"  
LC_MESSAGES="en_US.UTF-8"  
LC_MONETARY="en_US.UTF-8"  
LC_NUMERIC="en_US.UTF-8"  
LC_TIME="en_US.UTF-8"  
LC_ALL="en_US.UTF-8"  
(more…)

Building QT6.4 on Ubuntu 22.04

I installed required packages:

sudo apt install build-essential
sudo apt install libx11-dev
sudo apt install ninja-build
sudo apt install openssl libssl-dev
sudo apt install libmd4c-dev libmd4c-html0-dev
sudo apt install pkg-config
sudo apt install mesa-utils libglu1-mesa-dev freeglut3-dev mesa-common-dev
sudo apt install libglew-dev libglfw3-dev libglm-dev
sudo apt install libao-dev libmpg123-dev
(more…)

Building QT6.4 with qttranslation module for Windows

I was able to successfully build QT6.4 for Windows with skipped qttranslation and qttools modules. But if I do not skip them and configure QT as follows:

"C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvarsall.bat" amd64
    
set "CMAKE_ROOT=C:\dev\PFiles\cmake-3.24.0-rc4-windows-x86_64\bin"
set "NINJA_ROOT=C:\dev\PFiles\ninja-win"
set "PERL_ROOT=C:\dev\PFiles\Strawberry\perl\bin"
    
set PATH=%CMAKE_ROOT%;%PATH%
set PATH=%NINJA_ROOT%;%PATH%
set PATH=%PERL_ROOT%;%PATH%
set PATH=C:\dev\PFiles\Python35;%PATH%
    
rem Check if the tools are in PATH
where perl.exe
where python.exe
where cmake.exe
where ninja.exe
    
set MY_QT_SRC_DIR=C:\dev\repos\qt-everywhere-src-6.4.0
set "MY_INSTALL_PATH=C:/dev/libs/Qt6.4/windows"
set CL=/MP

%MY_QT_SRC_DIR%\configure.bat -prefix %MY_INSTALL_PATH% -DQT_NO_EXCEPTIONS=1 -debug-and-release -force-debug-info -platform win32-msvc -opensource -confirm-license ^
  -c++std c++20 -static -static-runtime -I "C:/Program Files/OpenSSL/include" -L "C:/Program Files/OpenSSL/lib" -openssl-linked ^
  -skip qt3d -skip qt5compat -skip qtactiveqt -skip qtcharts -skip qtcoap -skip qtconnectivity ^
  -skip qtdatavis3d -skip qtdoc -skip qtlottie -skip qtmqtt -skip qtnetworkauth -skip qtopcua ^
  -skip qtserialport -skip qtpositioning -skip qtquicktimeline -skip qtquick3d -skip qtremoteobjects ^
  -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtvirtualkeyboard -skip qtwayland ^
  -skip qtwebchannel -skip qtwebengine -skip qtwebview -skip qtquick3dphysics -skip qtspeech
(more…)

Specialization of parameterless template function in C++

At least this compiles and works:

#include <iostream>
#include <memory>
#include <string>

template <class T>
std::shared_ptr<T> make_instance();

template <class T> requires std::is_default_constructible_v<T>
std::shared_ptr<T> make_instance()
{
    return std::make_shared<T>();
}
(more…)

How I fixed my contact form

When I switched to PHP 7.4 I forgot to specify sendmail_path parameter in php.ini and my contact form stopped working. Today I found sendmail_path parameter in PHP 7.0:

cd /etc/php
find . -name "php.ini"
./7.0/fpm/php.ini
./7.0/cgi/php.ini
./7.0/cli/php.ini
./7.4/fpm/php.ini
./7.4/cli/php.ini
grep sendmail ./7.0/fpm/php.ini
sendmail_path = "/usr/sbin/sendmail -t -f *****@yandex.ru -i"
(more…)

Building QT6.4 with OpenSSL for Windows – iteration #1

I build it with similar commands as I used before for Building QT 6.3.1 with OpenSSL for Windows. The only difference was that I added -static-runtime option and skipped qtquick3dphysics and qtspeech modules:

"C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvarsall.bat" amd64
   
set "CMAKE_ROOT=C:\dev\PFiles\cmake-3.24.0-rc4-windows-x86_64\bin"
set "NINJA_ROOT=C:\dev\PFiles\ninja-win"
set "PERL_ROOT=C:\dev\PFiles\Strawberry\perl\bin"
   
set PATH=%CMAKE_ROOT%;%PATH%
set PATH=%NINJA_ROOT%;%PATH%
set PATH=%PERL_ROOT%;%PATH%
set PATH=C:\dev\PFiles\Python35;%PATH%
   
rem Check if the tools are in PATH
where perl.exe
where python.exe
where cmake.exe
where ninja.exe
   
set "MY_INSTALL_PATH=C:/dev/libs/Qt6.4/windows"
set CL=/MP
 
configure.bat -prefix %MY_INSTALL_PATH% -DQT_NO_EXCEPTIONS=1 -debug-and-release -force-debug-info -platform win32-msvc -opensource -confirm-license ^
-c++std c++20 -static -static-runtime -I "C:/Program Files/OpenSSL/include" -L "C:/Program Files/OpenSSL/lib" -openssl-linked ^
  -skip qt3d -skip qt5compat -skip qtactiveqt -skip qtcharts -skip qtcoap -skip qtconnectivity ^
  -skip qtdatavis3d -skip qtdoc -skip qtlottie -skip qtmqtt -skip qtnetworkauth -skip qtopcua ^
  -skip qtserialport -skip qtpositioning -skip qtquicktimeline -skip qtquick3d -skip qtremoteobjects ^
  -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtvirtualkeyboard -skip qtwayland ^
  -skip qtwebchannel -skip qtwebengine -skip qtwebview -skip qttools -skip qttranslations -skip qtquick3dphysics -skip qtspeech
(more…)

Converting WAV files with Sox

Source file:

soxi short-borrowed-old.wav
Input File     : 'short-borrowed-old.wav' (flac)
Channels       : 2
Sample Rate    : 44100
Precision      : 16-bit
Duration       : 00:00:00.60 = 26460 samples = 45 CDDA sectors
File Size      : 54.0k
Bit Rate       : 720k
Sample Encoding: 16-bit FLAC
Comment        : 'Comment=Processed by SoX'
(more…)

Throwing an exception from a function parameter in C++

There is no difference between lines 82 and 92 in the code below with both MSVC2022 and GCC11:

#include <utility>
#include <stdexcept>
#include <iostream>

struct Object
{
    virtual const char* name() = 0;

    virtual ~Object() = default;
};

struct A : public Object
{
    const char* name() override
    {
        return "A";
    }
};
(more…)