Building QT 6.3.1 with OpenSSL for Windows

After various experimentation I was able to build QT 6.3.1 with OpenSSL for Windows with the following steps:

Extract archives with Bash:

tar -xzf ../distrib/openssl-1.1.1q.tar.gz
tar -xf ../distrib/qt-everywhere-src-6.3.1.tar.xz

Building OpenSSL 1.1.1q

Run the following commands with x64 Native Tools Command Prompt for VS 2022:

set PATH=%PATH%;C:\dev\PFiles\Strawberry\perl\bin
set PATH=%PATH%;C:\dev\PFiles\nasm-2.15.05
perl Configure VC-WIN64A
(more…)

Experimentation with OpenSSL and QT configuration on Windows

Building OpenSSL 1.1.1q with custom installation directory

Run the following commands with x64 Native Tools Command Prompt for VS 2022:

set PATH=%PATH%;C:\dev\PFiles\Strawberry\perl\bin
set PATH=%PATH%;C:\dev\PFiles\nasm-2.15.05
set MY_INSTALL_DIR=C:/dev/libs/OpenSSL
perl Configure VC-WIN64A --prefix="%MY_INSTALL_DIR%" --openssldir="%MY_INSTALL_DIR%"
(more…)

Mining NEOXA on HiveOS with 3GB cards

The key to the success in mining NEOXA on HiveOS is knowing pool parameters that can be stratum+tcp://minenice.newpool.pw:1120, for example:

(more…)

Handling messages from Binance Websocket streams

User Data Stream

To subscribe I query listen key:

POST /api/v3/userDataStream

connect to websocket wss://stream.binance.com:9443/stream and send the listen key with the following message :

{
    "id": 1,
    "method": "SUBSCRIBE",
    "params": [
        "<my listen key>"
    ]
}

When Binance accepts the subscription it sends:

{
    "id": 1,
    "result": null
}
(more…)

Using std::future as a coroutine in C++20

In C++20 it is possible to do this:

std::future<int> compute(as_coroutine) {
  int a = co_await std::async([] { return 6; });
  int b = co_await std::async([] { return 7; });
  co_return a * b;
}
 
std::future<void> fail(as_coroutine) {
  throw std::runtime_error("bleah");
  co_return;
}
 
int main() {
  std::cout << compute({}).get() << '\n';
 
  try {
    fail({}).get();
  } catch (const std::runtime_error &e) {
    std::cout << "error: " << e.what() << '\n';
  }
}
(more…)

Switching to a different thread with async/await in C#

The code below switches to a different thread when the execution of Main() is resumed at line 11:

internal class Program
{
    static async Task Main(string[] args)
    {
        try
        {
            HttpClient client = new HttpClient();

            Console.WriteLine($"Thread: {Thread.CurrentThread.ManagedThreadId}");
                
            HttpResponseMessage response = await client.GetAsync("https://developernote.com/");

            Console.WriteLine($"Thread: {Thread.CurrentThread.ManagedThreadId}");

            response.EnsureSuccessStatusCode();

            string responseBody = await response.Content.ReadAsStringAsync();

            Console.WriteLine($"Thread: {Thread.CurrentThread.ManagedThreadId}");

            Console.WriteLine(responseBody);
        }
        catch (HttpRequestException e)
        {
            Console.WriteLine("\nException Caught!");

            Console.WriteLine($"Thread: {Thread.CurrentThread.ManagedThreadId}");

            Console.WriteLine($"Message: {e.Message}");
        }
    }
}
(more…)

My experimentation with QML Repeater

I was able to define a Repeater that displays cryptocurrency market orders:

(more…)

Testing Binance API with Postman

Clone the repository with Postman Collections and Environments:

git clone https://github.com/binance/binance-api-postman.git

Open the root repository folder:

(more…)

Building QT 6.3.0 for Android on Windows with C++20

An example of how it can be configured:

set "CMAKE_ROOT=E:\PFiles\cmake-3.21.3-windows-x86_64\bin"
set "NINJA_ROOT=E:\PFiles\ninja-win"
set "JDK_ROOT=C:\Program Files\Java\jdk1.8.0_301\bin"
set "MINGW_ROOT=E:\PFiles\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin"
set "PERL_ROOT=E:\PFiles\Strawberry\perl\bin"
       
set PATH=C:\WINDOWS\system32;C:\WINDOWS
set PATH=%CMAKE_ROOT%;%PATH%
set PATH=%NINJA_ROOT%;%PATH%
set PATH=%JDK_ROOT%;%PATH%
set PATH=%MINGW_ROOT%;%PATH%
set PATH=%PERL_ROOT%;%PATH%
set PATH=E:\PFiles\Python35;%PATH%
         
rem Check if the tools are in PATH
where gcc
where mingw32-make.exe
where perl.exe
where javac.exe
where python.exe
where cmake.exe
where ninja.exe
      
set "ANDROID_SDK_ROOT=C:\Users\D-Ef\AppData\Local\Android\Sdk"
set "ANDROID_NDK_PATH=C:\Users\D-Ef\AppData\Local\Android\Sdk\ndk\24.0.8215888"
set "ANDROID_BUILD_TOOLS_REVISION=31.0.0"
set "ANDROID_BUILD_ABI=x86_64"
rem set "ANDROID_BUILD_ABI=x86"
rem set "ANDROID_BUILD_ABI=arm64-v8a"
rem set "ANDROID_BUILD_ABI=armeabi-v7a"

set MY_INSTALL_PATH=E:/Qt/Qt6.3.0/android.%ANDROID_BUILD_ABI%
set QT_HOST_PATH=E:/Qt/Qt6.3.0/windows
      
configure.bat -platform win32-msvc -xplatform android-clang -prefix %MY_INSTALL_PATH% -qt-host-path %QT_HOST_PATH% ^
  -c++std c++20 -no-openssl ^
  -DQT_NO_EXCEPTIONS=1 -release -force-debug-info -opensource -confirm-license ^
  -android-sdk %ANDROID_SDK_ROOT% -android-ndk %ANDROID_NDK_PATH% -android-ndk-platform android-23 -android-abis %ANDROID_BUILD_ABI% ^
  -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
(more…)

Building QT 6.3.0 for Windows with OpenSSL and C++20

Now QT doesn’t like backslashes in configure.bat parameters. Also I updated vcvarsall.bat path and added -c++std c++20: and tried static build with -static option:

CALL "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
   
set "CMAKE_ROOT=E:\PFiles\cmake-3.21.3-windows-x86_64\bin"
set "NINJA_ROOT=E:\PFiles\ninja-win"
set "PERL_ROOT=E:\PFiles\Strawberry\perl\bin"
    
set PATH=%CMAKE_ROOT%;%PATH%
set PATH=%NINJA_ROOT%;%PATH%
set PATH=%PERL_ROOT%;%PATH%
set PATH=E:\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=E:\Qt\Qt6.3.0\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 -I "C:/Program Files/OpenSSL/include" -L "C:/Program Files/OpenSSL/lib"
(more…)