univrsal / input-overlay

Show keyboard, gamepad and mouse input on stream
GNU General Public License v2.0
2.68k stars 239 forks source link

did you forget to '#include <string>'? #344

Closed otakutyrant closed 12 months ago

otakutyrant commented 1 year ago

Describe the bug I tried to install obs-plugin-input-overlay from AUR and failed to compile it because:

> /home/otakutyrant/.cache/pikaur/build/obs-plugin-input-overlay/src/input-overlay/deps/common/input_data.hpp:63:34: error: ‘string’ is not a member of ‘std’
   63 |     std::unordered_map<int, std::string> remote_gamepad_names;

To Reproduce Execute pikaur -S obs-plugin-input-overlay in Arch Linux.

Expected behavior Installed successfully.

Versions

Additional context

The whole log shown as below:

$ aurin         obs-plugin-input-overlay
[sudo] password for otakutyrant:
Reading repository package databases...
Reading local package database...
Resolving AUR dependencies...

:: AUR package will be installed:
 obs-plugin-input-overlay                                   -> 5.0.3-1

:: Proceed with installation? [Y/n]
:: [v]iew package details   [m]anually select packages
>> y
looking for conflicting AUR packages...
:: warning: Not showing diff for obs-plugin-input-overlay package (installing for the first time)
Do you want to edit PKGBUILD for obs-plugin-input-overlay package? [Y/n] n

:: Starting the build:
==> Making package: obs-plugin-input-overlay 5.0.3-1 (Sun 07 May 2023 11:51:08 AM CST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Cloning input-overlay git repo...
Cloning into bare repository '/home/otakutyrant/.cache/pikaur/build/obs-plugin-input-overlay/input-overlay'...
remote: Enumerating objects: 12136, done.
remote: Counting objects: 100% (305/305), done.
remote: Compressing objects: 100% (105/105), done.
remote: Total 12136 (delta 218), reused 226 (delta 200), pack-reused 11831
Receiving objects: 100% (12136/12136), 57.31 MiB | 2.80 MiB/s, done.
Resolving deltas: 100% (8768/8768), done.
  -> Cloning obs-plugin-input-overlay-libgamepad git repo...
Cloning into bare repository '/home/otakutyrant/.cache/pikaur/build/obs-plugin-input-overlay/obs-plugin-input-overlay-libgamepad'...
remote: Enumerating objects: 944, done.
remote: Counting objects: 100% (213/213), done.
remote: Compressing objects: 100% (132/132), done.
remote: Total 944 (delta 125), reused 146 (delta 69), pack-reused 731
Receiving objects: 100% (944/944), 476.42 KiB | 599.00 KiB/s, done.
Resolving deltas: 100% (646/646), done.
  -> Cloning obs-plugin-input-overlay-libuiohook git repo...
Cloning into bare repository '/home/otakutyrant/.cache/pikaur/build/obs-plugin-input-overlay/obs-plugin-input-overlay-libuiohook'...
remote: Enumerating objects: 4986, done.
remote: Counting objects: 100% (1053/1053), done.
remote: Compressing objects: 100% (342/342), done.
remote: Total 4986 (delta 731), reused 957 (delta 660), pack-reused 3933
Receiving objects: 100% (4986/4986), 1.96 MiB | 999.00 KiB/s, done.
Resolving deltas: 100% (3647/3647), done.
==> Validating source files with md5sums...
    input-overlay ... Skipped
    obs-plugin-input-overlay-libgamepad ... Skipped
    obs-plugin-input-overlay-libuiohook ... Skipped
==> Extracting sources...
  -> Creating working copy of input-overlay git repo...
Cloning into 'input-overlay'...
done.
Switched to a new branch 'makepkg'
  -> Creating working copy of obs-plugin-input-overlay-libgamepad git repo...
Cloning into 'obs-plugin-input-overlay-libgamepad'...
done.
  -> Creating working copy of obs-plugin-input-overlay-libuiohook git repo...
Cloning into 'obs-plugin-input-overlay-libuiohook'...
done.
==> Starting prepare()...
Submodule 'deps/libuiohook' (https://github.com/kwhat/libuiohook) registered for path 'deps/libuiohook'
Cloning into '/home/otakutyrant/.cache/pikaur/build/obs-plugin-input-overlay/src/input-overlay/deps/libuiohook'...
done.
Submodule path 'deps/libuiohook': checked out '28ccf9c392ca5fd872a21246b49bf9ee2c0baf15'
==> Starting build()...
-- The C compiler identification is GNU 13.1.1
-- The CXX compiler identification is GNU 13.1.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1")
-- Checking for one of the modules 'sdl2'
-- Checking for module 'x11'
--   Found x11, version 1.8.4
-- Checking for module 'xtst'
--   Found xtst, version 1.2.4
-- Looking for XRecordQueryVersion in Xtst
-- Looking for XRecordQueryVersion in Xtst - found
-- Looking for X11/extensions/record.h
-- Looking for X11/extensions/record.h - found
-- Checking for module 'xkbcommon-x11'
--   Found xkbcommon-x11, version 1.5.0
-- Checking for module 'x11-xcb'
--   Found x11-xcb, version 1.8.4
-- Checking for module 'xkbfile'
--   Found xkbfile, version 1.1.2
-- Checking for module 'xt'
--   Found xt, version 1.3.0
-- Checking for module 'xinerama'
--   Found xinerama, version 1.1.5
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Qt version found: 6
-- Found OpenGL: /usr/lib/libOpenGL.so
-- Found WrapOpenGL: TRUE
-- Found XKB: /usr/lib/libxkbcommon.so (found suitable version "1.5.0", minimum required is "0.5.0")
-- Found WrapVulkanHeaders: /usr/include
-- Configuring done (1.9s)
-- Generating done (0.0s)
-- Build files have been written to: /home/otakutyrant/.cache/pikaur/build/obs-plugin-input-overlay/src/build
[  2%] Building C object deps/CMakeFiles/uiohook_static.dir/libuiohook/src/logger.c.o
[  5%] Building C object deps/CMakeFiles/uiohook_static.dir/libuiohook/src/x11/input_helper.c.o
[  8%] Building C object deps/CMakeFiles/uiohook_static.dir/libuiohook/src/x11/input_hook.c.o
[ 11%] Building C object deps/CMakeFiles/uiohook_static.dir/libuiohook/src/x11/post_event.c.o
[ 14%] Building C object deps/CMakeFiles/uiohook_static.dir/libuiohook/src/x11/system_properties.c.o
[ 17%] Linking C static library libuiohook_static.a
[ 17%] Built target uiohook_static
[ 20%] Automatic MOC and UIC for target input-overlay
[ 20%] Built target input-overlay_autogen
[ 23%] Building CXX object CMakeFiles/input-overlay.dir/input-overlay_autogen/mocs_compilation.cpp.o
[ 26%] Building CXX object CMakeFiles/input-overlay.dir/src/input_overlay.cpp.o
[ 29%] Building CXX object CMakeFiles/input-overlay.dir/src/sources/input_source.cpp.o
[ 32%] Building CXX object CMakeFiles/input-overlay.dir/src/hook/sdl_gamepad.cpp.o
[ 35%] Building CXX object CMakeFiles/input-overlay.dir/src/hook/gamepad_hook_helper.cpp.o
[ 38%] Building CXX object CMakeFiles/input-overlay.dir/src/gui/io_settings_dialog.cpp.o
[ 41%] Building CXX object CMakeFiles/input-overlay.dir/src/util/obs_util.cpp.o
[ 44%] Building CXX object CMakeFiles/input-overlay.dir/src/util/overlay.cpp.o
[ 47%] Building CXX object CMakeFiles/input-overlay.dir/src/util/element/element.cpp.o
[ 50%] Building CXX object CMakeFiles/input-overlay.dir/src/util/element/element_texture.cpp.o
[ 52%] Building CXX object CMakeFiles/input-overlay.dir/src/util/element/element_button.cpp.o
[ 55%] Building CXX object CMakeFiles/input-overlay.dir/src/util/element/element_mouse_wheel.cpp.o
[ 58%] Building CXX object CMakeFiles/input-overlay.dir/src/util/element/element_trigger.cpp.o
[ 61%] Building CXX object CMakeFiles/input-overlay.dir/src/util/element/element_analog_stick.cpp.o
[ 64%] Building CXX object CMakeFiles/input-overlay.dir/src/util/element/element_gamepad_id.cpp.o
[ 67%] Building CXX object CMakeFiles/input-overlay.dir/src/util/element/element_mouse_movement.cpp.o
[ 70%] Building CXX object CMakeFiles/input-overlay.dir/src/util/element/element_dpad.cpp.o
[ 73%] Building CXX object CMakeFiles/input-overlay.dir/src/network/remote_connection.cpp.o
[ 76%] Building CXX object CMakeFiles/input-overlay.dir/src/network/mg.cpp.o
[ 79%] Building CXX object CMakeFiles/input-overlay.dir/src/util/config.cpp.o
[ 82%] Building CXX object CMakeFiles/input-overlay.dir/src/util/input_filter.cpp.o
[ 85%] Building CXX object CMakeFiles/input-overlay.dir/src/network/websocket_server.cpp.o
[ 88%] Building CXX object CMakeFiles/input-overlay.dir/src/util/window_helper_nix.cpp.o
[ 91%] Building CXX object CMakeFiles/input-overlay.dir/src/hook/uiohook_helper_linux.cpp.o
[ 94%] Building CXX object CMakeFiles/input-overlay.dir/deps/common/input_data.cpp.o
In file included from /home/otakutyrant/.cache/pikaur/build/obs-plugin-input-overlay/src/input-overlay/deps/common/input_data.cpp:19:
/home/otakutyrant/.cache/pikaur/build/obs-plugin-input-overlay/src/input-overlay/deps/common/input_data.hpp:63:34: error: ‘string’ is not a member of ‘std’
   63 |     std::unordered_map<int, std::string> remote_gamepad_names;
      |                                  ^~~~~~
/home/otakutyrant/.cache/pikaur/build/obs-plugin-input-overlay/src/input-overlay/deps/common/input_data.hpp:28:1: note: ‘std::string’ is defined in header ‘<string>’; did you forget to ‘#include <string>’?
   27 | #include <keycodes.h>
  +++ |+#include <string>
   28 |
/home/otakutyrant/.cache/pikaur/build/obs-plugin-input-overlay/src/input-overlay/deps/common/input_data.hpp:63:40: error: template argument 2 is invalid
   63 |     std::unordered_map<int, std::string> remote_gamepad_names;
      |                                        ^
/home/otakutyrant/.cache/pikaur/build/obs-plugin-input-overlay/src/input-overlay/deps/common/input_data.hpp:63:40: error: template argument 5 is invalid
make[2]: *** [CMakeFiles/input-overlay.dir/build.make:412: CMakeFiles/input-overlay.dir/deps/common/input_data.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:102: CMakeFiles/input-overlay.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

Command 'makepkg --force' failed to execute.
:: Try recovering?
[R] retry build
[p] PGP check skip
[c] checksums skip
[f] skip 'check()' function of PKGBUILD
[n] skip 'prepare()' function of PKGBUILD
[i] ignore architecture
[d] delete build dir and try again
[e] edit PKGBUILD
------------------------
[s] skip building this package
[a] abort building all the packages
>
univrsal commented 1 year ago

try building again

otakutyrant commented 1 year ago

I tried building again and still encountered the same error.

univrsal commented 1 year ago

Try cloning the repo and building it manually. I have nothing to do with the aur package, so I don't know what it's doing.

patlefort commented 1 year ago

I can confirm the problem compiling with GCC 13 on version 5.0.3 of this plugin. It compile fine on the latest commit. I'm not sure what it could be, GCC bug?

univrsal commented 1 year ago

I guess, I'm pretty sure 5.0.3 did build at some point since I use arch myself. I'll try and make a new release with the missing header.

univrsal commented 12 months ago

Should be resolved, I think.