简体   繁体   中英

Visual Studio express shows error : “internal error occured in compiler”

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

在此处输入图片说明

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM