Eigen failed with error C2668 when build with MSVC
Submitted by Microsoft Visual C++ Team
Assigned to Nobody
Link to original bugzilla bug (#1672)
Operating system: Windows
Description
Hi All,
I tried to build Eigen on Windows with VS2017. It failed to build due to error C2668:'Eigen::test_isMuchSmallerThan': ambiguous call to overloaded function. Could you please help take a look at this? Thanks!
Steps to reproduce:
- hg clone https://bitbucket.org/eigen/eigen/ d:\Eigen\src
- Open a VS 2017 x64 command prompt and browse to D:\Eigen
- mkdir build_x64 && pushd build_x64
- cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_SYSTEM_VERSION=10.0.17134.0 -DEIGEN_BUILD_BTL=ON ..\src\
- msbuild /m /p:Configuration=Release;Platform=x64 Eigen3.sln /t:Rebuild
Actual result:
D:\Eigen\src\test\array_cwise.cpp(71): error C2668: 'Eigen::test_isMuchSmallerThan': ambiguous call to overloaded function
D:\Eigen\src\test\main.h(474): note: could be 'bool Eigen::test_isMuchSmallerThan(const long double &,const long double &)'
D:\Eigen\src\test\main.h(440): note: or 'bool Eigen::test_isMuchSmallerThan(const double &,const double &)'
D:\Eigen\src\test\main.h(433): note: or 'bool Eigen::test_isMuchSmallerThan(const float &,const float &)'
D:\Eigen\src\test\main.h(426): note: or 'bool Eigen::test_isMuchSmallerThan(const long &,const long)'
D:\Eigen\src\test\main.h(419): note: or 'bool Eigen::test_isMuchSmallerThan(const int &,const int &)'
D:\Eigen\src\test\array_cwise.cpp(71): note: while trying to match the argument list '(__int64, __int64)'
D:\Eigen\src\test\array_cwise.cpp(526): note: see reference to function template instantiation 'void array<Eigen::ArrayEigen::Index,-1,-1,0,-1,-1>(const ArrayType &)' being compiled
with
[
ArrayType=Eigen::Array<Eigen::Index,-1,-1,0,-1,-1>
]
D:\Eigen\src\test\array_cwise.cpp(72): error C2668: 'Eigen::test_isMuchSmallerThan': ambiguous call to overloaded function
D:\Eigen\src\test\main.h(474): note: could be 'bool Eigen::test_isMuchSmallerThan(const long double &,const long double &)'
D:\Eigen\src\test\main.h(440): note: or 'bool Eigen::test_isMuchSmallerThan(const double &,const double &)'
D:\Eigen\src\test\main.h(433): note: or 'bool Eigen::test_isMuchSmallerThan(const float &,const float &)'
D:\Eigen\src\test\main.h(426): note: or 'bool Eigen::test_isMuchSmallerThan(const long &,const long)'
D:\Eigen\src\test\main.h(419): note: or 'bool Eigen::test_isMuchSmallerThan(const int &,const int &)'
D:\Eigen\src\test\array_cwise.cpp(72): note: while trying to match the argument list '(__int64, __int64)'
D:\Eigen\src\test\array_cwise.cpp(74): error C2668: 'Eigen::test_isApprox': ambiguous call to overloaded function
D:\Eigen\src\test\main.h(465): note: could be 'bool Eigen::test_isApprox(const long double &,const long double &)'
D:\Eigen\src\test\main.h(438): note: or 'bool Eigen::test_isApprox(const double &,const double &)'
D:\Eigen\src\test\main.h(431): note: or 'bool Eigen::test_isApprox(const float &,const float &)'
D:\Eigen\src\test\main.h(424): note: or 'bool Eigen::test_isApprox(const long &,const long &)'
D:\Eigen\src\test\main.h(417): note: or 'bool Eigen::test_isApprox(const int &,const int &)'
D:\Eigen\src\test\main.h(414): note: or 'bool Eigen::test_isApprox(const unsigned long &,const unsigned long &)'
D:\Eigen\src\test\main.h(412): note: or 'bool Eigen::test_isApprox(const unsigned int &,const unsigned int &)'
D:\Eigen\src\test\main.h(410): note: or 'bool Eigen::test_isApprox(const unsigned short &,const unsigned short &)'
D:\Eigen\src\test\main.h(408): note: or 'bool Eigen::test_isApprox(const short &,const short &)'
D:\Eigen\src\test\array_cwise.cpp(74): note: while trying to match the argument list '(__int64, __int64)'