Compiling is completely broken with latest GCC 12.1.0 on Arch Linux and likely others.
I have been making use of osk-sdl on few tablets I have running Arch Linux. I noticed trying to set up osk-sdl on a new tablet it would fail in compiling and then testing it again it would fail to compile on all of my tablets. I'm not exactly sure what changed but when I tried looking up the error messages I got below I found I needed to add #include <array>
to the list of 'includes' in the 'keyboard.h' file.
[ransu@y40-80 osk-sdl]$ makepkg -Csi
==> Making package: osk-sdl 0.66-4 (Sat 21 May 2022 02:25:33 AM PDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Found osk-sdl-0.66.tar.gz
-> Found osk-sdl-hooks
-> Found osk-sdl-install
-> Found fix-config-parsing-with-libstdc++.patch
==> Validating source files with md5sums...
osk-sdl-0.66.tar.gz ... Passed
osk-sdl-hooks ... Passed
osk-sdl-install ... Passed
fix-config-parsing-with-libstdc++.patch ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
-> Extracting osk-sdl-0.66.tar.gz with bsdtar
==> Starting prepare()...
patching file src/config.cpp
Hunk #1 succeeded at 183 (offset -11 lines).
==> Starting build()...
+ exec meson setup --prefix /usr --libexecdir lib --sbindir bin --buildtype plain --auto-features enabled --wrap-mode nodownload -D b_lto=true -D b_pie=true osk-sdl-0.66 _build
The Meson build system
Version: 0.62.1
Source dir: /home/ransu/aur_projects/osk-sdl/src/osk-sdl-0.66
Build dir: /home/ransu/aur_projects/osk-sdl/src/_build
Build type: native build
Project name: osk-sdl
Project version: 0.66
C++ compiler for the host machine: c++ (gcc 12.1.0 "c++ (GCC) 12.1.0")
C++ linker for the host machine: c++ ld.bfd 2.38
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: /usr/bin/pkg-config (1.8.0)
Run-time dependency scdoc found: YES 1.11.2
Program /usr/bin/scdoc found: YES (/usr/bin/scdoc)
Program sh found: YES (/usr/bin/sh)
Run-time dependency sdl2 found: YES 2.0.22
Run-time dependency sdl2_ttf found: YES 2.0.18
Run-time dependency libcryptsetup found: YES 2.4.3
Program xvfb-run found: NO
osk-sdl-0.66/test/meson.build:5: WARNING: Xvfb is required to run tests
Build targets in project: 3
NOTICE: Future-deprecated features used:
* 0.55.0: {'ExternalProgram.path'}
* 0.56.0: {'dependency.get_pkgconfig_variable'}
osk-sdl 0.66
User defined options
auto_features: enabled
buildtype : plain
libexecdir : lib
prefix : /usr
sbindir : bin
wrap_mode : nodownload
b_lto : true
b_pie : true
Found ninja-1.10.2 at /usr/bin/ninja
ninja: Entering directory `/home/ransu/aur_projects/osk-sdl/src/_build'
[3/11] Compiling C++ object osk-sdl.p/src_config.cpp.o
FAILED: osk-sdl.p/src_config.cpp.o
c++ -Iosk-sdl.p -I. -I../osk-sdl-0.66 -I/usr/include/SDL2 -flto=auto -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -std=c++2a -O0 '-DVERSION="0.66"' -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -fPIE -D_REENTRANT -MD -MQ osk-sdl.p/src_config.cpp.o -MF osk-sdl.p/src_config.cpp.o.d -o osk-sdl.p/src_config.cpp.o -c ../osk-sdl-0.66/src/config.cpp
In file included from ../osk-sdl-0.66/src/util.h:23,
from ../osk-sdl-0.66/src/config.cpp:21:
../osk-sdl-0.66/src/keyboard.h:58:49: error: field ‘rows’ has incomplete type ‘std::array<std::vector<std::__cxx11::basic_string<char> >, 4>’
58 | std::array<std::vector<std::string>, 4> rows;
| ^~~~
In file included from /usr/include/c++/12.1.0/bits/stl_map.h:63,
from /usr/include/c++/12.1.0/map:61,
from ../osk-sdl-0.66/src/config.h:22,
from ../osk-sdl-0.66/src/config.cpp:20:
/usr/include/c++/12.1.0/tuple:1595:45: note: declaration of ‘struct std::array<std::vector<std::__cxx11::basic_string<char> >, 4>’
1595 | template<typename _Tp, size_t _Nm> struct array;
| ^~~~~
[4/11] Compiling C++ object osk-sdl.p/src_draw_helpers.cpp.o
FAILED: osk-sdl.p/src_draw_helpers.cpp.o
c++ -Iosk-sdl.p -I. -I../osk-sdl-0.66 -I/usr/include/SDL2 -flto=auto -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -std=c++2a -O0 '-DVERSION="0.66"' -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -fPIE -D_REENTRANT -MD -MQ osk-sdl.p/src_draw_helpers.cpp.o -MF osk-sdl.p/src_draw_helpers.cpp.o.d -o osk-sdl.p/src_draw_helpers.cpp.o -c ../osk-sdl-0.66/src/draw_helpers.cpp
In file included from ../osk-sdl-0.66/src/draw_helpers.h:22,
from ../osk-sdl-0.66/src/draw_helpers.cpp:21:
../osk-sdl-0.66/src/keyboard.h:58:49: error: field ‘rows’ has incomplete type ‘std::array<std::vector<std::__cxx11::basic_string<char> >, 4>’
58 | std::array<std::vector<std::string>, 4> rows;
| ^~~~
In file included from /usr/include/c++/12.1.0/bits/stl_map.h:63,
from /usr/include/c++/12.1.0/map:61,
from ../osk-sdl-0.66/src/config.h:22,
from ../osk-sdl-0.66/src/keyboard.h:22:
/usr/include/c++/12.1.0/tuple:1595:45: note: declaration of ‘struct std::array<std::vector<std::__cxx11::basic_string<char> >, 4>’
1595 | template<typename _Tp, size_t _Nm> struct array;
| ^~~~~
[5/11] Compiling C++ object osk-sdl.p/src_keyboard.cpp.o
FAILED: osk-sdl.p/src_keyboard.cpp.o
c++ -Iosk-sdl.p -I. -I../osk-sdl-0.66 -I/usr/include/SDL2 -flto=auto -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -std=c++2a -O0 '-DVERSION="0.66"' -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -fPIE -D_REENTRANT -MD -MQ osk-sdl.p/src_keyboard.cpp.o -MF osk-sdl.p/src_keyboard.cpp.o.d -o osk-sdl.p/src_keyboard.cpp.o -c ../osk-sdl-0.66/src/keyboard.cpp
In file included from ../osk-sdl-0.66/src/keyboard.cpp:21:
../osk-sdl-0.66/src/keyboard.h:58:49: error: field ‘rows’ has incomplete type ‘std::array<std::vector<std::__cxx11::basic_string<char> >, 4>’
58 | std::array<std::vector<std::string>, 4> rows;
| ^~~~
In file included from /usr/include/c++/12.1.0/bits/stl_map.h:63,
from /usr/include/c++/12.1.0/map:61,
from ../osk-sdl-0.66/src/config.h:22,
from ../osk-sdl-0.66/src/keyboard.h:22:
/usr/include/c++/12.1.0/tuple:1595:45: note: declaration of ‘struct std::array<std::vector<std::__cxx11::basic_string<char> >, 4>’
1595 | template<typename _Tp, size_t _Nm> struct array;
| ^~~~~
ninja: build stopped: subcommand failed.
==> ERROR: A failure occurred in build().
Aborting...
[ransu@y40-80 osk-sdl]$
Edited by Administrator