NovaGL / HarmonyHubControl

C++ Application to Control a Logitech Harmony Hub
MIT License
25 stars 9 forks source link

Build issues under linux with gcc 6.3 #6

Closed pccasto closed 5 years ago

pccasto commented 6 years ago

Running make (with the default gcc 6.3) under Debian stretch generates an error as it works its way down the included files:

/usr/include/c++/6/ext/string_conversions.h:72:25: error: ‘ERANGE’ was not declared in this scope
       else if (errno == ERANGE

Compiling with gcc 4.9 is successful. I found that others had had to revert to that gcc version to compile after googling for the error message.

However I think I've found a better solution:

I made a change to line 9 of csocket.h to change the include from asm/error.h to cerrno. This allowed the compilation to now succeed while using gcc 6.3.

My understanding is that by calling the include in this fashion would take care of the namespace/scope issues. I'm not enough of a c++ programmer to know if there are other unintended consequences of that change, but it appears to be a solution. If this makes sense I can do a pull request, or you can fold it in as you see fit.

jgrimble commented 6 years ago

I was able to build this code on a Raspberry Pi 3 using the feedback from pccasto (Thank you pccasto for this!!!).

You can build using gcc-4.9 with the following;

  1. first download gcc-4.9... sudo apt-get install gcc-4.9 g++-4.9

  2. CD into the directory of the HarmonyHubControl

  3. Build with backdated compiler by using... make CXX=g++-4.9 CC=gcc-4.9

When I enter the following into the terminal... ./HarmonyHubControl [IP] list_activities ...it does not list my activities. Does anyone have a fix for this issue?

NovaGL commented 5 years ago

Guessing due to the age, you no longer want an answer and have found a better repo. Feel free to reopen it if required.