cvuchener / hidpp

Collection of HID++ tools
GNU General Public License v3.0
90 stars 23 forks source link

compile errors with gcc 11.2.1 #20

Closed pfps closed 3 years ago

pfps commented 3 years ago

I'm trying to build hidpp on Fedora with gcc 11.2.1 and I'm getting compiler errors.

The first few are:

In file included from /home/local/SoftwareDownloads/hidpp/src/libhidpp/hidpp/Device.cpp:19:
/home/local/SoftwareDownloads/hidpp/src/libhidpp/hidpp/Device.h:46:22: error: ‘string’ in namespace ‘std’ does not name a type
   46 |                 std::string _msg;
      |                      ^~~~~~
/home/local/SoftwareDownloads/hidpp/src/libhidpp/hidpp/Device.h:25:1: note: ‘std::string’ is defined in header ‘<string>’; did you forget to ‘#include <string>’?
   24 | #include <tuple>
  +++ |+#include <string>
   25 | 
/home/local/SoftwareDownloads/hidpp/src/libhidpp/hidpp/Device.h:83:14: error: ‘string’ in namespace ‘std’ does not name a type
   83 |         std::string name () const;
      |              ^~~~~~

I was able to fix these (and more) by adding `#include ' to Device.h

But now I am getting error: ‘runtime_error’ is not a member of ‘std’. How do I fix this?

cvuchener commented 3 years ago

Weird, I'm using fedora and gcc 11.2.1, I did not notice that. Could give the full list of missing includes? runtime_error should be defined in stdexcept.

pfps commented 3 years ago

I must have been using an old copy of hidpp, or had some teething problems.

I just deleted hidpp and re-cloned it and removed all controlling environment variables and the compilation is working fine.

Sorry for the incorrect alarm.