Visual Studio express shows error : “internal erro

2019-08-03 22:34发布

I created visual studio files for the c++ library g2o using cmake. But when I try to build it, it is failing showing an error at some template definitions.

template<>
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());
}

As I am not an expert in c++, I am not sure what is going wrong in this line of code. I tried commenting this code and building. Then the build fails on the next template definition. Is it an issue with visual studio?

The error shown is

enter image description here

The same code is working perfectly on linux. But I need to run it on my windows machine as debugging is easier and I have only limited access to the linux machine. Any help will be appreciated.

1条回答
不美不萌又怎样
2楼-- · 2019-08-03 23:14

In windows VS environment, you need to change the template specification. Change the template<> into template< Eigen::MatrixXd > will works

查看更多
登录 后发表回答