开发者

Error C2719 in header files - without using stl:vector

I have some problems with compiling my code. There are couple of functions which can't be compiled because of error C2719 - formal parameter with __declspec(align('16')) won't be aligned.

Functions which VisualStudio can't compile look like that

Eigen::Matrix2d AlgorithmBase::ReverseTransform(Eigen::Vector2d point, Eigen::Vector2d *translation, Eigen::Matrix2d *scaling, double phi, Eigen::Matrix2d *share)
{
    Eigen::Matrix2d reversedScaling;
    reversedScaling(0,0) = 1/(*scaling)(0,0);
    reversedScaling(0,1) = reversedScaling(1,0) = 0;
    reversedScaling(1,1) = 1/(*scaling)(1,1);
    Eigen::MatrixXd  newTranslation = -1**translation;

    开发者_StackOverflow社区return  MatrixHelper::CreateRotationMatrix(-phi)* *scaling*point + newTranslation;
}

void TemplateClusterBase::SetScalingMatrix( Eigen::Matrix2d matrix )
{
    if(matrix.rows() == 1 || matrix.cols()==1) 
    {
        this->scalingMatrix = MatrixHelper::CreateScalingMatrix(matrix(0,0));
    }
    else
    {
        this->scalingMatrix = matrix;
    }
}

It's quite strange because of the fact that previously I used MatrixXd instead of Vector2d and Matrix2d and everything was fine. What is more this is common problem when using stl:vector - however as You can see this functions doesn't take as a parameter stl:vector.

What can I do to fix this?


Compiler error C2719 has nothing to do with STL, it is telling you that you are not allowed to use the 'align' __declspec modifier on formal parameter declarations.

To fix your problem, you need to declare your functions without using __declspec(align (...)). Of course you aren't explicitly using __declspec so really you need to figure out how/why it is being used on your behalf.

A good place to start might be the definition of Eigen::Matrix2d.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜