laurentkneip / opengv

OpenGV is a collection of computer vision methods for solving geometric vision problems. It is hosted and maintained by the Mobile Perception Lab of ShanghaiTech.
Other
1.02k stars 353 forks source link

Library will not compile with eigen_3.34 #74

Open antithing opened 6 years ago

antithing commented 6 years ago

Hi, I am trying to build on windows, visual studio 2017, using eigen 3.34.

I get errors here:

https://github.com/laurentkneip/opengv/blob/master/src/absolute_pose/modules/main.cpp#L773

like:

Severity    Code    Description Project File    Line    Suppression State
Error   C2784   'std::complex<_Other> std::operator *(const _Ty &,const std::complex<_Other> &)': could not deduce template argument for 'const std::complex<_Other> &' from 'const Eigen::Matrix<double,1,10,1,1,10>'  opengv  d:\opengv-master\opengv-master\src\absolute_pose\modules\main.cpp   773 

among others. Is this an eigen issue?

willer94 commented 5 years ago

I got the same error in win7 vs 2013 using eigen3-3-5, but the problem solved using eigen3-2-10. I also got error "cl : Command line error D8021 : invalid numeric argument '/Wextra'", I deleted the ADD_DEFINITIONS in CMakeLists.txt and solved the problem.

IF(MSVC) ADD_DEFINITIONS ( -Wall

-Wextra

#-Werror
#-Wwrite-strings
#-Wno-unused-parameter
-fno-strict-aliasing
)

ELSE() ADD_DEFINITIONS ( -Wall -Wextra

-Werror

-Wwrite-strings
-Wno-unused-parameter
-fno-strict-aliasing
)

ENDIF()

lucasamparo commented 5 years ago

Downgrade your Eigen version to 3.2.10 and maybe work. Works for me. I think could be close.