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

Error compiling on Ubuntu 20.04 because of old catch2.hpp #131

Closed
frankgraz opened this issue Jan 15, 2023 · 3 comments · Fixed by #132
Closed

Error compiling on Ubuntu 20.04 because of old catch2.hpp #131

frankgraz opened this issue Jan 15, 2023 · 3 comments · Fixed by #132

Comments

@frankgraz
Copy link

Get the following errors:

[ 75%] Building CXX object tests/conf_file/CMakeFiles/test_conf_file.dir/test_conf_file.cc.o
In file included from /usr/include/signal.h:328,
from /usr/viewtouch/src/viewtouch/external/catch2/catch.hpp:8034,
from /usr/viewtouch/src/viewtouch/tests/conf_file/test_conf_file.cc:2:
/usr/viewtouch/src/viewtouch/external/catch2/catch.hpp:10822:58: error: call to non-‘constexpr’ function ‘long int sysconf(int)’
10822 | static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
| ^~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24,
from /usr/include/signal.h:328,
from /usr/viewtouch/src/viewtouch/external/catch2/catch.hpp:8034,
from /usr/viewtouch/src/viewtouch/tests/conf_file/test_conf_file.cc:2:
/usr/include/unistd.h:640:17: note: ‘long int sysconf(int)’ declared here
640 | extern long int sysconf (int __name) __THROW;
| ^~~~~~~
In file included from /usr/viewtouch/src/viewtouch/tests/conf_file/test_conf_file.cc:2:
/usr/viewtouch/src/viewtouch/external/catch2/catch.hpp:10881:45: error: size of array ‘altStackMem’ is not an integral constant-expression
10881 | char FatalConditionHandler::altStackMem[sigStackSize] = {};
| ^~~~~~~~~~~~
make[2]: *** [tests/conf_file/CMakeFiles/test_conf_file.dir/build.make:76: tests/conf_file/CMakeFiles/test_conf_file.dir/test_conf_file.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:598: tests/conf_file/CMakeFiles/test_conf_file.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

@NeroBurner
Copy link
Contributor

hmm, this shouldn't happen. Please provide more info about your used distro and compiler versions to have a starting point to debug and reproduce this issue

@frankgraz
Copy link
Author

I resolved the issue after doing some research on the error. I am using ubuntu 20.04 and mint 21. The version of catch.hpp under the ../src/viewtouch/external/catch2 is outdated for glibc 2.35.

The steps i used to resolve the error:

  • sudo apt install catch2

  • in ../src/viewtouch/src/external/catch2 i made a backup copy of catch.hpp as catch.hpp.backup by issuing the command mv catch.hpp catch.hpp.backup

  • i copied the file catch.hpp from /usr/include/catch2 to ../src/viewtouch/external/catch2

It built without an error

@NeroBurner
Copy link
Contributor

Thanks for the investigation and reporting back. So I'll need to update the embedded catch2.hpp file to a more recent version

@NeroBurner NeroBurner changed the title Error compiling Error compiling on Ubuntu 20.04 because of old catch2.hpp Jan 16, 2023
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

Successfully merging a pull request may close this issue.

2 participants