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

build error: no match for operator++ / operator- #488

Open
cryptix opened this issue Dec 21, 2021 · 1 comment
Open

build error: no match for operator++ / operator- #488

cryptix opened this issue Dec 21, 2021 · 1 comment

Comments

@cryptix
Copy link

cryptix commented Dec 21, 2021

Does somebody know what this is about?

/build/source/pointmatcher/DataPointsFilters/Gestalt.cpp:499:9: error: no match for 'operator++' (operand type is 'Eigen::internal::enable_if<true, Eigen::IndexedView<Eigen::Matrix<double, -1, -1>, double, double> >::type {aka Eigen::IndexedView<Eigen::Matrix<double, -1, -1>, double, double>}')
         ++(numOfValues(indices(0,it), indices(1,it)));
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/source/pointmatcher/DataPointsFilters/Gestalt.cpp:514:71: error: no match for 'operator-' (operand types are 'Eigen::DenseCoeffsBase<Eigen::Matrix<double, -1, 1>, 1>::Scalar {aka double}' and 'Eigen::internal::enable_if<true, Eigen::IndexedView<Eigen::Matrix<double, -1, -1>, double, double> >::type {aka Eigen::IndexedView<Eigen::Matrix<double, -1, -1>, double, double>}')
         gestaltVariances(indices(0,it), indices(1,it)) += (heights(it)-gestaltMeans(indices(0,it), indices(1,it))) * (heights(it)-gestaltMeans(indices(0,it), indices(1,it)));
                                                           ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/source/pointmatcher/DataPointsFilters/Gestalt.cpp:514:130: error: no match for 'operator-' (operand types are 'Eigen::DenseCoeffsBase<Eigen::Matrix<double, -1, 1>, 1>::Scalar {aka double}' and 'Eigen::internal::enable_if<true, Eigen::IndexedView<Eigen::Matrix<double, -1, -1>, double, double> >::type {aka Eigen::IndexedView<Eigen::Matrix<double, -1, -1>, double, double>}')
         gestaltVariances(indices(0,it), indices(1,it)) += (heights(it)-gestaltMeans(indices(0,it), indices(1,it))) * (heights(it)-gestaltMeans(indices(0,it), indices(1,it)));

This is on linux using gcc 7.5, 8 and 10 and eigen 3.4.0 boost 1.5.5 and 1.6.5.

@smileyenot983
Copy link

smileyenot983 commented Mar 31, 2022

i fixed it by changing following lines in CMakeLists.txt:

lines 132-150 into:

#--------------------
# DEPENDENCY: eigen 3
#--------------------
# find_path(EIGEN_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
#   HINTS  ENV EIGEN3_INC_DIR
#          ENV EIGEN3_DIR
#   PATHS  Eigen/Core
#          /usr/local/include
#          /usr/include
#   PATH_SUFFIXES include eigen3 eigen
#   DOC "Directory containing the Eigen3 header files"
# )

# Suppress Eigen's warning by adding it to the system's library
# include_directories(SYSTEM "${EIGEN_INCLUDE_DIR}")

#TODO: this should be a more standard way
find_package(Eigen3 REQUIRED)
message("-- eigen3 , version ${EIGEN_VERSION}")

and lines 394-396:

target_link_libraries(pointmatcher PUBLIC Eigen3::Eigen ${Boost_LIBRARIES})
target_link_libraries(pointmatcher PRIVATE Eigen3::Eigen ${libnabo_LIBRARIES})
target_link_libraries(pointmatcher PRIVATE Eigen3::Eigen ${EXTERNAL_LIBS})

According to docs in Eigen, there are 2 ways to use Eigen:

  1. add headers as include
  2. add them into cmake through find_package

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