Sophus icon indicating copy to clipboard operation
Sophus copied to clipboard

Wrong compiler standard in CMakeLists.txt

Open adryan1994 opened this issue 1 year ago • 1 comments

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

  1. git clone https://github.com/strasdat/Sophus.git
  2. cd Sophus && mkdir build && cd build
  3. cmake ..
  4. make

Expected behavior Successful installation

Sophus version: commit hash

61f9a98

adryan1994 avatar May 12 '23 11:05 adryan1994

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.

Alex-Beh avatar May 30 '23 14:05 Alex-Beh

#538 updates to c++17 among other changes. Please re-open if more changes to the cmake file is needed.

strasdat avatar Jun 10 '24 06:06 strasdat