Sophus
Sophus copied to clipboard
Wrong compiler standard in CMakeLists.txt
System information (version)
- Sophus => 1.22.10
- Operating System / Platform => Linux / Ubuntu 22.04 LTS
- Compiler => gcc 11.3.0
Multiple errors occurring during installation process because of C++14 compiler standard instead of C++17 in CMakeLists.txt file:
/usr/local/include/ceres/product_manifold.h:274:36: note: ‘std::void_t’ is only available from C++17 onwards
Solution:
- Change line 27 to
set(CMAKE_CXX_STANDARD 17)
- Change line 37 to
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wextra -std=c++17-Wno-deprecated-declarations -ftemplate-backtrace-limit=0")
Steps to Reproduce
-
git clone https://github.com/strasdat/Sophus.git
-
cd Sophus && mkdir build && cd build
-
cmake ..
-
make
Expected behavior Successful installation
Sophus version: commit hash
Hi, I am facing the same issue and managed to compile the project with your suggestion. I think it would be great if you can open an PR for this issue.
#538 updates to c++17 among other changes. Please re-open if more changes to the cmake file is needed.