Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling from Source on Debian 12 Bookworm #22

Open
blizzard4591 opened this issue Oct 25, 2023 · 1 comment
Open

Compiling from Source on Debian 12 Bookworm #22

blizzard4591 opened this issue Oct 25, 2023 · 1 comment

Comments

@blizzard4591
Copy link

Dear Maintainers,

I am trying to compile Homegear on Debian 12 with G++ 12.2.

src/HelperFunctions/Net.h, src/HelperFunctions/Math.h and src/Security/Gcrypt.cpp are missing ´#include ´, since they make use of std::array but do not import it.
This failed compilation with GCC 12.

Furthermore, the include order for sched.h seems wrong, since this happens:

In file included from Settings/Settings.cpp:31:
Settings/Settings.h:252:36: error: 'SCHED_OTHER' was not declared in this scope
  252 |   int32_t _rpcServerThreadPolicy = SCHED_OTHER;
      |                                    ^~~~~~~~~~~
Settings/Settings.h:252:36: note: the macro 'SCHED_OTHER' had not yet been defined
In file included from /usr/include/sched.h:43,
                 from /usr/include/pthread.h:22,
                 from /usr/include/aarch64-linux-gnu/c++/12/bits/gthr-default.h:35,
                 from /usr/include/aarch64-linux-gnu/c++/12/bits/gthr.h:148,
                 from /usr/include/c++/12/ext/atomicity.h:35,
                 from /usr/include/c++/12/bits/shared_ptr_base.h:61,
                 from /usr/include/c++/12/bits/shared_ptr.h:53,
                 from /usr/include/c++/12/memory:77,
                 from Settings/../Database/DatabaseTypes.h:38,
                 from Settings/../Database/IDatabaseController.h:34,
                 from Settings/../BaseLib.h:34,
                 from Settings/Settings.cpp:32:
/usr/include/aarch64-linux-gnu/bits/sched.h:28: note: it was later defined here
   28 | #define SCHED_OTHER             0

This can be solved by switching the include order of BaseLib.h and Settings.h in Settings.cpp.

Since I am not sure of how development is done here, I did not create a pull request. If you point me to the branch you want, I can do that.

@mrumpf
Copy link

mrumpf commented Feb 10, 2024

I solved the array related issues by adding the include:

#include <array>

The SCHED_OTHER compiler error can also be solved by putting the following additional include into the file:

#include <sched.h> 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants