Category Archives: Operating Systems

Google Play Console displays std::exception message

My Android game crashed on a user’s device at the highlighted line:

GameMovement::GameMovement(GameField& field, CellCoord from, CellCoord to) :
    m_field(field),
    pBall(m_field.GetCell(from))
{
    GameGraph graph(&m_field, from, to);

    m_path.reserve(m_field.GetColumnCount() + m_field.GetRowCount());

    if (!graph.FindPath(m_path))
    {
        throw std::runtime_error("Path not found.");
    }

    if (m_path.size() < 2)
    {
        throw std::runtime_error("Wrong path.");
    }
}
(more…)

Building Vulkan samples for Android

Cloned the repository:

git clone https://github.com/SaschaWillems/Vulkan.git
git submodule init
git submodule update

Updated assets:

python.exe download_assets.py
(more…)

Building a C++ project with MinGW using Visual Studio Code

In CMake Tools extension settings I specified my CMake path:

and built my project with MSVC 2022 first and then switched to MinGW.

Building a project with MSVC 2022

On my machine with installed MSVC 2022 it automatically generated configuration file %LocalAppData%/CMakeTools/cmake-tools-kits.json:

[
  {
    "name": "Visual Studio Professional 2022 Release - amd64",
    "visualStudio": "04bbaecf",
    "visualStudioArchitecture": "x64",
    "preferredGenerator": {
      "name": "Visual Studio 17 2022",
      "platform": "x64",
      "toolset": "host=x64"
    }
  },
  {
    "name": "Visual Studio Professional 2022 Release - amd64_x86",
    "visualStudio": "04bbaecf",
    "visualStudioArchitecture": "x64",
    "preferredGenerator": {
      "name": "Visual Studio 17 2022",
      "platform": "win32",
      "toolset": "host=x64"
    }
  },
(more…)

Compiling a C++ source file in Visual Studio Code with MinGW

I followed this instruction and configured C/C++ extension as follows:

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.19041.0",
            "compilerPath": "D:\\dev\\tools\\x86_64-12.2.0-release-win32-seh-rt_v10-rev0\\mingw64\\bin\\g++.exe",
            "cStandard": "c17",
            "cppStandard": "c++17",
            "intelliSenseMode": "windows-gcc-x64"
        }
    ],
    "version": 4
}
(more…)

Building QT6.4.2 for MacOS and iOS

Build QT for MacOS separately in Debug and Release configuration:

tar xf qt-everywhere-src-6.4.2.tar.xz
cd ~/build/qt
export MY_QT_SRC_DIR=~/repos/qt-everywhere-src-6.4.2
export MY_MODE=release
#export MY_MODE=debug

export MY_INSTALL_PATH=~/libs/QT6.4/${MY_MODE}/MacOs
${MY_QT_SRC_DIR}/configure -prefix $MY_INSTALL_PATH -c++std c++20 -opensource -confirm-license \
  -static -static-runtime -${MY_MODE} -force-debug-info \
  -no-openssl -securetransport -DQT_NO_EXCEPTIONS=1 \
  -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 -skip qtlocation \
  -skip qthttpserver \
  -- -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \
  && cmake --build . --parallel \
  && cmake --install .
(more…)

Touch target size on Android

Probably QT “Fusion” is not an appropriate style for Android apps, because its buttons height is not enough:

(more…)

Creating Windows Application Icon on Ubuntu 22.04

Install magick tool:

sudo apt update
sudo apt install imagemagick

Copy *.png files to a folder, for example:

win16x16.png
win32x32.png
win48x48.png
win64x64.png

and run the following command:

convert *.png winapp.ico

QT6 multimedia module crashes on iOS

After several hours of playing sounds my iOS app crashes and the QT Creator displays the following stack trace:

1 caulk::thread::join() (x86_64) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/caulk.framework/caulk 0x7fff49a06293
2 std::__shared_ptr_emplace<AURemoteIO::IOThread, std::allocator<AURemoteIO::IOThread>>::__on_zero_shared() (x86_64) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/AudioToolbox.framework/libEmbeddedSystemAUs.dylib 0x7fff438a7469
3 AURemoteIO::Stop() (x86_64) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/AudioToolbox.framework/libEmbeddedSystemAUs.dylib 0x7fff438a58d3
4 ausdk::AUMethodStop(void *) (x86_64) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/AudioToolbox.framework/libEmbeddedSystemAUs.dylib 0x7fff438f3529
5 QDarwinAudioSink::audioDeviceStop() qdarwinaudiosink.mm 619 0x10ffa7afd
6 QDarwinAudioSink::audioDeviceIdle() qdarwinaudiosink.mm 629 0x10ffa7b68
7 QDarwinAudioSink::renderCallback(void *, unsigned int *, AudioTimeStamp const *, unsigned int, unsigned int, AudioBufferList *) qdarwinaudiosink.mm 446 0x10ffa7ab7
8 ausdk::AUInputElement::PullInput(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int) (x86_64) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/AudioToolbox.framework/libEmbeddedSystemAUs.dylib 0x7fff438f12d2
9 AUInputFormatConverter2::InputProc(OpaqueAudioConverter *, unsigned int *, AudioBufferList *, AudioStreamPacketDescription * *, void *) (x86_64) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/AudioToolbox.framework/libEmbeddedSystemAUs.dylib 0x7fff4382cf27
10 acv1::AudioConverterChain::CallInputProc(unsigned int) (x86_64) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AudioToolboxCore.framework/AudioToolboxCore 0x7fff30323840
11 acv1::AudioConverterChain::FillBufferFromInputProc(unsigned int *, CADeprecated::CABufferList *) (x86_64) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AudioToolboxCore.framework/AudioToolboxCore 0x7fff3032467f
12 acv1::BufferedAudioConverter::GetInputBytes(unsigned int, unsigned int&, CADeprecated::CABufferList const *&) (x86_64) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AudioToolboxCore.framework/AudioToolboxCore 0x7fff3045c7bd
13 acv1::CBRConverter::RenderOutput(CADeprecated::CABufferList *, unsigned int, unsigned int&, AudioStreamPacketDescription *) (x86_64) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AudioToolboxCore.framework/AudioToolboxCore 0x7fff303091bc
14 acv1::BufferedAudioConverter::FillBuffer(unsigned int&, AudioBufferList&, AudioStreamPacketDescription *) (x86_64) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AudioToolboxCore.framework/AudioToolboxCore 0x7fff3045c589
15 acv1::AudioConverterChain::RenderOutput(CADeprecated::CABufferList *, unsigned int, unsigned int&, AudioStreamPacketDescription *) (x86_64) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AudioToolboxCore.framework/AudioToolboxCore 0x7fff303235bb
16 acv1::BufferedAudioConverter::FillBuffer(unsigned int&, AudioBufferList&, AudioStreamPacketDescription *) (x86_64) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AudioToolboxCore.framework/AudioToolboxCore 0x7fff3045c589
17 acv1::_AudioConverterFillComplexBuffer(OpaqueAudioConverter *, int ( *)(OpaqueAudioConverter *, unsigned int *, AudioBufferList *, AudioStreamPacketDescription * *, void *), void *, unsigned int *, AudioBufferList *, AudioStreamPacketDescription *, AudioStreamPacketDependencyInfo *) (x86_64) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AudioToolboxCore.framework/AudioToolboxCore 0x7fff30491df6
18 AudioConverterFillComplexBuffer (x86_64) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AudioToolboxCore.framework/AudioToolboxCore 0x7fff303a3680
19 AUConverterBase::RenderBus(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int) (x86_64) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/AudioToolbox.framework/libEmbeddedSystemAUs.dylib 0x7fff4382b617
20 AURemoteIO::RenderBus(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int) (x86_64) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/AudioToolbox.framework/libEmbeddedSystemAUs.dylib 0x7fff438a4317
21 ausdk::AUBase::DoRender(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int, AudioBufferList&) (x86_64) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/AudioToolbox.framework/libEmbeddedSystemAUs.dylib 0x7fff438f06a9
22 AURemoteIO::PerformIO(unsigned int, unsigned int, unsigned int, AudioTimeStamp const&, AudioTimeStamp const&, AudioBufferList const *, AudioBufferList *, unsigned int&) (x86_64) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/AudioToolbox.framework/libEmbeddedSystemAUs.dylib 0x7fff438af7df
23 _XPerformIO (x86_64) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/AudioToolbox.framework/libEmbeddedSystemAUs.dylib 0x7fff438e9817
24 mshMIGPerform (x86_64) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libAudioToolboxUtility.dylib 0x7fff2e30936a
25 MSHMIGDispatchMessage (x86_64) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libAudioToolboxUtility.dylib 0x7fff2e309759
26 void * caulk::thread_proxy<std::tuple<caulk::thread::attributes, AURemoteIO::IOThread::IOThread(AURemoteIO&, caulk::thread::attributes const&, caulk::mach::os_workgroup const&)::'lambda'(), std::tuple<>>>(void *) (x86_64) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/AudioToolbox.framework/libEmbeddedSystemAUs.dylib 0x7fff438a7200
27 _pthread_start (x86_64) /usr/lib/system/libsystem_pthread.dylib 0x7fff6da2b8fc
28 thread_start (x86_64) /usr/lib/system/libsystem_pthread.dylib 0x7fff6da27443
(more…)

What is the difference between -nativeScale and -scale on UIScreen in iOS

Found the answer on stackoverflow.com and installed iPhone 6 Plus simulator:

(more…)

Building QT6.4 on Windows for Android with OpenSSL and clang 14

Installed latest NDK:

(more…)