sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-13 g++-13
ll /usr/bin/gcc-13
ll /usr/bin/g++-13
update-alternatives --display gcc
ll /etc/alternatives/g*
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 10 --slave /usr/bin/g++ g++ /usr/bin/g++-13
g++ --version
gcc --version
Author Archives: dmitriano
Installing GCC13 on Ubuntu 22.04
Building QT6.5.2 for X11 on Ubuntu 22.04
In addition to the packages installed while building QT6.4 I installed the following packages required for X11:
sudo apt install libfontconfig1-dev libfreetype6-dev libx11-dev libx11-xcb-dev \
libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev \
libxcb-cursor-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev \
libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev libxcb-xfixes0-dev \
libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-util-dev \
libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev
And configured QT with dynamic linking:
export MY_INSTALL_PATH=/home/def/libs/QT6.5d
export QT_SRC_PATH=/home/def/repos/qt-everywhere-src-6.5.2
${QT_SRC_PATH}/configure -prefix $MY_INSTALL_PATH -DQT_NO_EXCEPTIONS=1 -debug-and-release -force-debug-info -opensource -confirm-license \
-c++std c++20 -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 qtwebchannel -skip qtwebengine -skip qtwebview -skip qtquick3dphysics -skip qtspeech -skip qtlocation \
-skip qthttpserver
An example of overloading operator << in C++
The code below is compiled successfully with both GCC and MSVC:
#include <iostream>
#include <sstream>
template <class C>
class basic_format
{
public:
template <typename T>
basic_format & operator << (const T & val)
{
out << val;
return *this;
}
std::basic_string<C> str() const { return out.str(); }
operator std::basic_string<C>() const { return str(); }
private:
std::basic_ostringstream<C> out;
};
“Cannot anchor to a null item” waring in QML
The following QML code
Callout
{
id: call
//margins should bound but not assigned
anchors.topMargin: root.above ? undefined : yMargin
anchors.bottomMargin: root.above ? yMargin : undefined
...
}
produced “Cannot anchor to a null item” warning and worked incorrectly.
I tried to replace it with AnchorChanges
and PropertyChanges
:
Sharing Android phone over TCP with ADB
I was able to share my Android phone over TCP with the following commands:
adb kill-server
start cmd /k adb -a -P 5037 nodaemon server start
Building RenderDoc for Android on WSL
I cloned the repository, created build directory, set environment variables and run CMake:
git clone https://github.com/baldurk/renderdoc.git
cd renderdoc/
mkdir build-android
cd build-android
export JAVA_HOME=~/dev/repos/graphicsprofiler/tools/buildtools/jdk
export ANDROID_SDK=~/dev/repos/graphicsprofiler/tools/buildtools/android
export ANDROID_NDK=~/dev/repos/graphicsprofiler/tools/buildtools/android/ndk-bundle/android-ndk-r20b
export PATH=$PATH:$JAVA_HOME/bin
cmake -DBUILD_ANDROID=On -DANDROID_ABI=armeabi-v7a ..
Generating a certificate for Huawei App Gallery
List existing certificates:
set PATH=%PATH%;C:\Program Files\Android\Android Studio\jbr\bin
keytool.exe -list -v -keystore linesgame.keystore
Generate the new one:
keytool.exe -genkey -v -keystore linesgame.keystore -alias linesgame-huawei -keyalg RSA -keysize 2048 -validity 100000
Running GUI apps on WSL
Updating existing WSL installation
I updated WSL according to this MS guide:
wsl --update
wsl --shutdown
wsl --version
WSL version: 1.2.0.0
Kernel version: 5.15.90.1
WSLg version: 1.0.51
MSRDC version: 1.2.3770
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19045.2604