【发布时间】:2018-06-22 12:08:33
【问题描述】:
我有一个适用于 Lunix/GCC 的代码。但是,在 Windows/MSVC 2017 上编译时,我面临一个internal compiler error:
.hpp:
namespace g2o {
namespace internal {
template<typename MatrixType>
inline void axpy(const MatrixType& A, const Eigen::Map<const Eigen::VectorXd>& x, int xoff, Eigen::Map<Eigen::VectorXd>& y, int yoff) {
y.segment<MatrixType::RowsAtCompileTime>(yoff) += A * x.segment<MatrixType::ColsAtCompileTime>(xoff);
}
template<int t>
inline void axpy(const Eigen::Matrix<double, Eigen::Dynamic, t>& A, const Eigen::Map<const Eigen::VectorXd>& x, int xoff, Eigen::Map<Eigen::VectorXd>& y, int yoff) {
y.segment(yoff, A.rows()) += A * x.segment<Eigen::Matrix<double, Eigen::Dynamic, t>::ColsAtCompileTime>(xoff);
}
template<> /*******ERROR HERE*******/
inline void axpy(const Eigen::MatrixXd& A, const Eigen::Map<const Eigen::VectorXd>& x, int xoff, Eigen::Map<Eigen::VectorXd>& y, int yoff) {
y.segment(yoff, A.rows()) += A * x.segment(xoff, A.cols());
}
} // end namespace internal
} // end namespace g2o
我看到解决方案告诉我应该执行以下操作:
template<Eigen::MatrixXd> inline void axpy<Eigen::MatrixXd> ....
但是,它不起作用。
编译器生成的错误消息:
Error C1001 编译器发生内部错误。
【问题讨论】:
-
报错真的不说什么了吗?
-
@usr2564301 是的,它没有
-
@KenWhite 好的,我编辑了
-
贴一个完整的导致编译器崩溃的程序,我们可以研究一下。
-
MSVC 2017 最近更新了很多。最好在问题中包含完整的版本号。
标签: c++ templates visual-studio-2017 internal-compiler-error