Build error: 'BUS_RMI' was not declared in this scope
When I try to build, I get the following error:
/tmp/nix-build-interception-tools-0.1.0.drv-1/tools-v0.1.0-6273ff20caf51618d8efe4542dd90d28e30fd175/uinput.cpp:37:6: error: 'BUS_RMI' was not declared in this scope
{BUS_RMI, "BUS_RMI"},
^
/tmp/nix-build-interception-tools-0.1.0.drv-1/tools-v0.1.0-6273ff20caf51618d8efe4542dd90d28e30fd175/uinput.cpp:38:6: error: 'BUS_CEC' was not declared in this scope
{BUS_CEC, "BUS_CEC"},
^
/tmp/nix-build-interception-tools-0.1.0.drv-1/tools-v0.1.0-6273ff20caf51618d8efe4542dd90d28e30fd175/uinput.cpp:39:1: error: could not convert '{{1, "BUS_PCI"}, {2, "BUS_ISAPNP"}, {3, "BUS_USB"}, {4, "BUS_HIL"}, {5, "BUS_BLUETOOTH"}, {6, "BUS_VIRTUAL"}, {16, "BUS_ISA"}, {17, "BUS_I8042"}, {18, "BUS_XTKBD"}, {19, "BUS_RS232"}, {20, "BUS_GAMEPORT"}, {21, "BUS_PARPORT"}, {22, "BUS_AMIGA"}, {23, "BUS_ADB"}, {24, "BUS_I2C"}, {25, "BUS_HOST"}, {26, "BUS_GSC"}, {27, "BUS_ATARI"}, {28, "BUS_SPI"}, {<expression error>, "BUS_RMI"}, {<expression error>, "BUS_CEC"}}' from '<brace-enclosed initializer list>' to 'std::map<int, std::__cxx11::basic_string<char> >'
};
^
/tmp/nix-build-interception-tools-0.1.0.drv-1/tools-v0.1.0-6273ff20caf51618d8efe4542dd90d28e30fd175/uinput.cpp:61:17: error: 'BUS_RMI' was not declared in this scope
{"BUS_RMI", BUS_RMI},
^
/tmp/nix-build-interception-tools-0.1.0.drv-1/tools-v0.1.0-6273ff20caf51618d8efe4542dd90d28e30fd175/uinput.cpp:62:17: error: 'BUS_CEC' was not declared in this scope
{"BUS_CEC", BUS_CEC},
^
/tmp/nix-build-interception-tools-0.1.0.drv-1/tools-v0.1.0-6273ff20caf51618d8efe4542dd90d28e30fd175/uinput.cpp:63:1: error: could not convert '{{"BUS_PCI", 1}, {"BUS_ISAPNP", 2}, {"BUS_USB", 3}, {"BUS_HIL", 4}, {"BUS_BLUETOOTH", 5}, {"BUS_VIRTUAL", 6}, {"BUS_ISA", 16}, {"BUS_I8042", 17}, {"BUS_XTKBD", 18}, {"BUS_RS232", 19}, {"BUS_GAMEPORT", 20}, {"BUS_PARPORT", 21}, {"BUS_AMIGA", 22}, {"BUS_ADB", 23}, {"BUS_I2C", 24}, {"BUS_HOST", 25}, {"BUS_GSC", 26}, {"BUS_ATARI", 27}, {"BUS_SPI", 28}, {"BUS_RMI", <expression error>}, {"BUS_CEC", <expression error>}}' from '<brace-enclosed initializer list>' to 'std::map<std::__cxx11::basic_string<char>, int>'
};
^
(I know the above error message is for v0.1.0, but I get the same error for master too.)
When I remove these BUS_RMI and BUS_CEC lines, so when I apply the following patch:
From 81ecbc5631895a61265a7ef4b1ff226414d8ee23 Mon Sep 17 00:00:00 2001
From: xd1le <elisp.vim@gmail.com>
Date: Tue, 22 Aug 2017 16:16:11 +1000
Subject: [PATCH] remove some BUS stuff
That are not declared for some reason and therefore cause building to
fail.
---
uinput.cpp | 4 ----
1 file changed, 4 deletions(-)
diff --git a/uinput.cpp b/uinput.cpp
index cbb67bd..c4b1bf3 100644
--- a/uinput.cpp
+++ b/uinput.cpp
@@ -34,8 +34,6 @@ std::map<int, std::string> bus_string = {
{BUS_GSC, "BUS_GSC"},
{BUS_ATARI, "BUS_ATARI"},
{BUS_SPI, "BUS_SPI"},
- {BUS_RMI, "BUS_RMI"},
- {BUS_CEC, "BUS_CEC"},
};
std::map<std::string, int> string_bus = {
@@ -58,8 +56,6 @@ std::map<std::string, int> string_bus = {
{"BUS_GSC", BUS_GSC},
{"BUS_ATARI", BUS_ATARI},
{"BUS_SPI", BUS_SPI},
- {"BUS_RMI", BUS_RMI},
- {"BUS_CEC", BUS_CEC},
};
void print_usage(std::FILE *stream, const char *program) {
--
2.14.1
and use the interception tools with the official caps2esc plugin (using the suggested caps2esc udevmon job configuration), it seems to work just fine.
So why is BUS_RMI and BUS_CEC not being declared, would it be something to do with my system in particular? And if so, could this be detected/handled instead of raising a build error (since it seems to work fine without it)? I don't have a problem with using the patch if I need to, I just mainly want to understand or know what's happening.
PS - Thank you so much for writing this awesome tool, it's soo useful and great!!