colmap / glomap

GLOMAP - Global Structured-from-Motion Revisited
BSD 3-Clause "New" or "Revised" License
1.29k stars 76 forks source link

compile error in /usr/local/include/PoseLib/alignment.h:88:1: error: redefinition of ‘class std::vector<Eigen::Matrix<float, 3, 4>, std::allocator<Eigen::Matrix<float, 3, 4> > >’ #43

Open bettertime1994 opened 1 month ago

bettertime1994 commented 1 month ago

Hi i install colmap and poselib as https://github.com/colmap/glomap/blob/4f3b2c17c743039cf4f83736c087b26c4dbe3c5e/cmake/FindDependencies.cmake#L3 and https://github.com/colmap/glomap/blob/4f3b2c17c743039cf4f83736c087b26c4dbe3c5e/cmake/FindDependencies.cmake#L16

but i get err log as vy@CNSHHQSF021:~/disk2/code/glomap/build$ ninja [1/10] Building CXX object glomap/CMakeFiles/glomap.dir/estimators/relpose_estimation.cc.o FAILED: glomap/CMakeFiles/glomap.dir/estimators/relpose_estimation.cc.o /usr/bin/ccache /usr/lib/ccache/c++ -DCERES_EXPORT_INTERNAL_SYMBOLS -DGFLAGS_IS_A_DLL=0 -DGLOG_CUSTOM_PREFIX_SUPPORT -DOPENMP_ENABLED -DPOSELIB_DEBUG=0 -I/home/vy/disk2/code/glomap/glomap/.. -I/usr/include/suitesparse -isystem /usr/local/. -isystem /usr/local/include/eigen3 -fopenmp -std=gnu++17 -Wall -Werror -fpermissive -Wno-sign-compare -Wno-unused-variable -fopenmp -MD -MT glomap/CMakeFiles/glomap.dir/estimators/relpose_estimation.cc.o -MF glomap/CMakeFiles/glomap.dir/estimators/relpose_estimation.cc.o.d -o glomap/CMakeFiles/glomap.dir/estimators/relpose_estimation.cc.o -c /home/vy/disk2/code/glomap/glomap/estimators/relpose_estimation.cc In file included from /usr/local/include/PoseLib/types.h:32, from /home/vy/disk2/code/glomap/glomap/../glomap/estimators/relpose_estimation.h:5, from /home/vy/disk2/code/glomap/glomap/estimators/relpose_estimation.cc:1: /usr/local/include/PoseLib/alignment.h:88:1: error: redefinition of ‘class std::vector<Eigen::Matrix<double, 2, 1>, std::allocator<Eigen::Matrix<double, 2, 1> > >’ 88 | EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION_CUSTOM(Eigen::Vector2d) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/local/include/colmap/sensor/models.h:32, from /usr/local/include/colmap/scene/camera.h:32, from /home/vy/disk2/code/glomap/glomap/../glomap/scene/camera.h:5, from /home/vy/disk2/code/glomap/glomap/../glomap/scene/types_sfm.h:3, from /home/vy/disk2/code/glomap/glomap/../glomap/estimators/relpose_estimation.h:3, from /home/vy/disk2/code/glomap/glomap/estimators/relpose_estimation.cc:1: /usr/local/include/colmap/util/eigen_alignment.h:89:1: note: previous definition of ‘class std::vector<Eigen::Matrix<double, 2, 1>, std::allocator<Eigen::Matrix<double, 2, 1> > >’ whats happend

bettertime1994 commented 1 month ago

when i use colmap and Poselib in glomap as set it on: https://github.com/colmap/glomap/blob/4f3b2c17c743039cf4f83736c087b26c4dbe3c5e/CMakeLists.txt#L14

i see the same error: In file included from /home/vy/disk2/code/glomap/build/_deps/poselib-src/PoseLib/types.h:32, from /home/vy/disk2/code/glomap/glomap/../glomap/estimators/relpose_estimation.h:5, from /home/vy/disk2/code/glomap/glomap/estimators/relpose_estimation.cc:1: /home/vy/disk2/code/glomap/build/_deps/poselib-src/PoseLib/alignment.h:61: error: "EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION_CUSTOM" redefined [-Werror] 61 #define EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION_CUSTOM(...) \
In file included from /home/vy/disk2/code/glomap/build/_deps/colmap-src/src/colmap/sensor/models.h:32, from /home/vy/disk2/code/glomap/build/_deps/colmap-src/src/colmap/scene/camera.h:32, from /home/vy/disk2/code/glomap/glomap/../glomap/scene/camera.h:5, from /home/vy/disk2/code/glomap/glomap/../glomap/scene/types_sfm.h:3, from /home/vy/disk2/code/glomap/glomap/../glomap/estimators/relpose_estimation.h:3, from /home/vy/disk2/code/glomap/glomap/estimators/relpose_estimation.cc:1: /home/vy/disk2/code/glomap/build/_deps/colmap-src/src/colmap/util/eigen_alignment.h:56: note: this is the location of the previous definition 56 #define EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION_CUSTOM(...) \

In file included from /home/vy/disk2/code/glomap/build/_deps/poselib-src/PoseLib/types.h:32, from /home/vy/disk2/code/glomap/glomap/../glomap/estimators/relpose_estimation.h:5, from /home/vy/disk2/code/glomap/glomap/estimators/relpose_estimation.cc:1: /home/vy/disk2/code/glomap/build/_deps/poselib-src/PoseLib/alignment.h:64:11: error: redefinition of ‘class std::vector<Eigen::Matrix<double, 2, 1>, std::allocator<Eigen::Matrix<double, 2, 1> > >’ 64 | class vector<VA_ARGS, std::allocator<VA_ARGS>> \ | ^~~~~~~~~~~~ /home/vy/disk2/code/glomap/build/_deps/poselib-src/PoseLib/alignment.h:88:1: note: in expansion of macro ‘EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION_CUSTOM’

Ling-Bao commented 4 weeks ago

Hi i install colmap and poselib as

https://github.com/colmap/glomap/blob/4f3b2c17c743039cf4f83736c087b26c4dbe3c5e/cmake/FindDependencies.cmake#L3

and https://github.com/colmap/glomap/blob/4f3b2c17c743039cf4f83736c087b26c4dbe3c5e/cmake/FindDependencies.cmake#L16

but i get err log as vy@CNSHHQSF021:~/disk2/code/glomap/build$ ninja [1/10] Building CXX object glomap/CMakeFiles/glomap.dir/estimators/relpose_estimation.cc.o FAILED: glomap/CMakeFiles/glomap.dir/estimators/relpose_estimation.cc.o /usr/bin/ccache /usr/lib/ccache/c++ -DCERES_EXPORT_INTERNAL_SYMBOLS -DGFLAGS_IS_A_DLL=0 -DGLOG_CUSTOM_PREFIX_SUPPORT -DOPENMP_ENABLED -DPOSELIB_DEBUG=0 -I/home/vy/disk2/code/glomap/glomap/.. -I/usr/include/suitesparse -isystem /usr/local/. -isystem /usr/local/include/eigen3 -fopenmp -std=gnu++17 -Wall -Werror -fpermissive -Wno-sign-compare -Wno-unused-variable -fopenmp -MD -MT glomap/CMakeFiles/glomap.dir/estimators/relpose_estimation.cc.o -MF glomap/CMakeFiles/glomap.dir/estimators/relpose_estimation.cc.o.d -o glomap/CMakeFiles/glomap.dir/estimators/relpose_estimation.cc.o -c /home/vy/disk2/code/glomap/glomap/estimators/relpose_estimation.cc In file included from /usr/local/include/PoseLib/types.h:32, from /home/vy/disk2/code/glomap/glomap/../glomap/estimators/relpose_estimation.h:5, from /home/vy/disk2/code/glomap/glomap/estimators/relpose_estimation.cc:1: /usr/local/include/PoseLib/alignment.h:88:1: error: redefinition of ‘class std::vector<Eigen::Matrix<double, 2, 1>, std::allocator<Eigen::Matrix<double, 2, 1> > >’ 88 | EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION_CUSTOM(Eigen::Vector2d) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/local/include/colmap/sensor/models.h:32, from /usr/local/include/colmap/scene/camera.h:32, from /home/vy/disk2/code/glomap/glomap/../glomap/scene/camera.h:5, from /home/vy/disk2/code/glomap/glomap/../glomap/scene/types_sfm.h:3, from /home/vy/disk2/code/glomap/glomap/../glomap/estimators/relpose_estimation.h:3, from /home/vy/disk2/code/glomap/glomap/estimators/relpose_estimation.cc:1: /usr/local/include/colmap/util/eigen_alignment.h:89:1: note: previous definition of ‘class std::vector<Eigen::Matrix<double, 2, 1>, std::allocator<Eigen::Matrix<double, 2, 1> > >’ whats happend

I add predefined in colmap/util/eigen_alignment.h as follow

ifndef POSELIB_ALIGNMENTH

define POSELIB_ALIGNMENTH

...

endif