Skip to content

Windows build fails because of Eigen assertion YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY #23

Description

@ithron

Windows build fails because Eigen complains about incompatible binary types. However, this error does not occur on any other platform.

The relevant part of the build log is listed below.

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\CL.exe /c /IC:\projects\cortidqct\lib\..\include\CortidQCT\src /IC:\projects\cortidqct\lib /IC:\projects\cortidqct\common\..\include /IC:\hunter\_Base\70287b1\b8646f3\ca53d5c\Install\include /IC:\hunter\_Base\70287b1\b8646f3\ca53d5c\Install\include\eigen3 /I"C:\Tools\vcpkg\installed\x64-windows\include" /nologo /W0 /WX- /diagnostics:classic /MP /O2 /Ob2 /D WIN32 /D _WINDOWS /D NDEBUG /D _SCL_SECURE_NO_WARNINGS /D _SILENCE_CXX17_UNCAUGHT_EXCEPTION_DEPRECATION_WARNING /D "CMAKE_INTDIR=\"Release\"" /D _MBCS /Gm- /EHsc /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /openmp /std:c++17 /Fo"Core.dir\Release\\" /Fd"Core.dir\Release\Core.pdb" /Gd /TP /FC /errorReport:queue  /w /bigobj C:\projects\cortidqct\lib\CortidQCT.cpp C:\projects\cortidqct\lib\ColorToLabelMapIO.cpp C:\projects\cortidqct\lib\DisplacementOptimizer.cpp C:\projects\cortidqct\lib\MeasurementModel.cpp C:\projects\cortidqct\lib\Mesh.cpp C:\projects\cortidqct\lib\MeshFitter.cpp C:\projects\cortidqct\lib\MeshFitterConfiguration.cpp C:\projects\cortidqct\lib\MeshFitterImpl.cpp C:\projects\cortidqct\lib\VoxelVolume.cpp C:\projects\cortidqct\lib\WeightedARAPFitter.cpp
6791  CortidQCT.cpp
6792  ColorToLabelMapIO.cpp
6793  DisplacementOptimizer.cpp
6794  MeasurementModel.cpp
6795  Mesh.cpp
6796c:\hunter\_base\70287b1\b8646f3\ca53d5c\install\include\eigen3\eigen\src\core\assignevaluator.h(834): error C2338: YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY (compiling source file C:\projects\cortidqct\lib\DisplacementOptimizer.cpp) [C:\projects\cortidqct\lib\Core.vcxproj]
6797  c:\hunter\_base\70287b1\b8646f3\ca53d5c\install\include\eigen3\eigen\src\core\assignevaluator.h(804): note: see reference to function template instantiation 'void Eigen::internal::call_assignment_no_alias<Dst,Src,Func>(Dst &,const Src &,const Func &)' being compiled
6798          with
6799          [
6800              Dst=Eigen::ArrayWrapper<Eigen::VectorXf>,
6801              Src=Eigen::CwiseUnaryOp<CortidQCT::Internal::DisplacementOptimizer::()::<lambda_3a9a3fea05e2923a7b71cf246b74ff27>,const Eigen::ArrayWrapper<const CortidQCT::Internal::LabelVector>>,
6802              Func=Eigen::internal::div_assign_op<float,unsigned int>
6803          ] (compiling source file C:\projects\cortidqct\lib\DisplacementOptimizer.cpp)
6804  c:\hunter\_base\70287b1\b8646f3\ca53d5c\install\include\eigen3\eigen\src\core\arraybase.h(220): note: see reference to function template instantiation 'void Eigen::internal::call_assignment<Derived,Eigen::CwiseUnaryOp<CortidQCT::Internal::DisplacementOptimizer::()::<lambda_3a9a3fea05e2923a7b71cf246b74ff27>,const Eigen::ArrayWrapper<const Eigen::Matrix<CortidQCT::Mesh<float>::Label,-1,1,0,-1,1>>>,Eigen::internal::div_assign_op<float,unsigned int>>(Dst &,const Src &,const Func &,void *)' being compiled
6805          with
6806          [
6807              Derived=Eigen::ArrayWrapper<Eigen::VectorXf>,
6808              Dst=Eigen::ArrayWrapper<Eigen::VectorXf>,
6809              Src=Eigen::CwiseUnaryOp<CortidQCT::Internal::DisplacementOptimizer::()::<lambda_3a9a3fea05e2923a7b71cf246b74ff27>,const Eigen::ArrayWrapper<const CortidQCT::Internal::LabelVector>>,
6810              Func=Eigen::internal::div_assign_op<float,unsigned int>
6811          ] (compiling source file C:\projects\cortidqct\lib\DisplacementOptimizer.cpp)
6812  c:\projects\cortidqct\lib\displacementoptimizer.cpp(184): note: see reference to function template instantiation 'Derived &Eigen::ArrayBase<Derived>::operator /=<Eigen::CwiseUnaryOp<CortidQCT::Internal::DisplacementOptimizer::()::<lambda_3a9a3fea05e2923a7b71cf246b74ff27>,const Eigen::ArrayWrapper<const Eigen::Matrix<CortidQCT::Mesh<float>::Label,-1,1,0,-1,1>>>>(const Eigen::ArrayBase<Eigen::CwiseUnaryOp<CortidQCT::Internal::DisplacementOptimizer::()::<lambda_3a9a3fea05e2923a7b71cf246b74ff27>,const Eigen::ArrayWrapper<const Eigen::Matrix<CortidQCT::Mesh<float>::Label,-1,1,0,-1,1>>>> &)' being compiled
6813          with
6814          [
6815              Derived=Eigen::ArrayWrapper<Eigen::VectorXf>
6816          ]
6817  c:\projects\cortidqct\lib\displacementoptimizer.cpp(181): note: see reference to function template instantiation 'Derived &Eigen::ArrayBase<Derived>::operator /=<Eigen::CwiseUnaryOp<CortidQCT::Internal::DisplacementOptimizer::()::<lambda_3a9a3fea05e2923a7b71cf246b74ff27>,const Eigen::ArrayWrapper<const Eigen::Matrix<CortidQCT::Mesh<float>::Label,-1,1,0,-1,1>>>>(const Eigen::ArrayBase<Eigen::CwiseUnaryOp<CortidQCT::Internal::DisplacementOptimizer::()::<lambda_3a9a3fea05e2923a7b71cf246b74ff27>,const Eigen::ArrayWrapper<const Eigen::Matrix<CortidQCT::Mesh<float>::Label,-1,1,0,-1,1>>>> &)' being compiled
6818          with
6819          [
6820              Derived=Eigen::ArrayWrapper<Eigen::VectorXf>
6821          ]
6822  c:\projects\cortidqct\lib\displacementoptimizer.cpp(193): note: see reference to function template instantiation 'CortidQCT::Internal::DisplacementOptimizer::DisplacementsWeightsPair CortidQCT::Internal::DisplacementOptimizer::operator ()<Eigen::Matrix<float,-1,3,0,-1,3>,CortidQCT::Internal::LabelVector,Eigen::VectorXf>(const Eigen::MatrixBase<Eigen::Matrix<float,-1,3,0,-1,3>> &,const Eigen::MatrixBase<CortidQCT::Internal::LabelVector> &,const Eigen::MatrixBase<Eigen::VectorXf> &,size_t)' being compiled
6823  MeshFitter.cpp

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions