This forum has been archived. All content is frozen. Please use KDE Discuss instead.

C2719: 'prec': formal parameter with __declspec(align('16'))

Tags: None
(comma "," separated)
lyh03259
Registered Member
Posts
5
Karma
0
Hello eigen users and developers,

Here are something I really don't understand. I tried by best to read this explanation (http://eigen.tuxfamily.org/dox/TopicUna ... rt.html#c1) but I don't see any one of them match my case (or maybe I don't understand it well. It is difficult for a physics graduate student :) ).

I am using MS visual studio professional 2010 with Eigen 3.0.5.
The following code doesn't work. It gives C2719 error.
Code: Select all
#include <Eigen/Dense>
#include <iostream>

int main()
{
   Eigen::Matrix<Eigen::Matrix2d, 2, 1> a2;
}


The same code works when using MINGW. Can anybody point out the solution for it?
Thanks.
Waldfee
Registered Member
Posts
7
Karma
0
Hi all,
any update on this issue?

I face the same problem. I would like to place a custom type inside a 3D vector of Eigen and run into the same compiler error.
Hence, I have to write my own cross product functions among others for that specific type.

Thanks.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
Hi, we would need more details, i.e., at least the precise error messages.
Waldfee
Registered Member
Posts
7
Karma
0
Hi ggael,

the errors are as follows:
eigen\src/Core/DenseBase.h(366): error C2719: 'prec': formal parameter with __declspec(align('16')) won't be aligned
eigen\src/Core/DenseBase.h(368): error C2719: 'prec': formal parameter with __declspec(align('16')) won't be aligned
eigen\src/Core/DenseBase.h(371): error C2719: 'prec': formal parameter with __declspec(align('16')) won't be aligned
eigen\src/Core/DenseBase.h(372): error C2719: 'prec': formal parameter with __declspec(align('16')) won't be aligned
eigen\src/Core/DenseBase.h(373): error C2719: 'prec': formal parameter with __declspec(align('16')) won't be aligned
eigen\src/Core/DenseBase.h(374): error C2719: 'prec': formal parameter with __declspec(align('16')) won't be aligned
eigen\src/Core/MatrixBase.h(272): error C2719: 'm_epsilon': formal parameter with __declspec(align('16')) won't be aligned
eigen\src/Core/MatrixBase.h(288): error C2719: 'prec': formal parameter with __declspec(align('16')) won't be aligned
eigen\src/Core/MatrixBase.h(289): error C2719: 'prec': formal parameter with __declspec(align('16')) won't be aligned
eigen\src/Core/MatrixBase.h(291): error C2719: 'prec': formal parameter with __declspec(align('16')) won't be aligned
eigen\src/Core/MatrixBase.h(292): error C2719: 'prec': formal parameter with __declspec(align('16')) won't be aligned
eigen\src/Core/MatrixBase.h(295): error C2719: 'prec': formal parameter with __declspec(align('16')) won't be aligned
eigen\src/Core/MatrixBase.h(297): error C2719: 'prec': formal parameter with __declspec(align('16')) won't be aligned
eigen\src/Core/DenseBase.h(363): error C2719: 'prec': formal parameter with __declspec(align('16')) won't be aligned

According to http://msdn.microsoft.com/en-us/library ... y1(v=vs.71).aspx Visual C does not allow the align argument in a function call. However, the type I'm placing into the Eigen Matrix has to be aligned. I currently cannot produce a minimal useful example, but the errors in my case are the same as with the code example in the first post.

Thanks.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
I prepared a patch there:

http://eigen.tuxfamily.org/bz/show_bug.cgi?id=482

maybe the same changes will be needed for the other modules...
Waldfee
Registered Member
Posts
7
Karma
0
Hi ggael,

thanks for the patch. This helps a lot.
There are a couple of other places I found in my code, as without your patch MSVC gave up after 100 errors.

eigen\src/Geometry/Scaling.h(113): error C2719: 'prec': formal parameter with __declspec(align('16')) won't be aligned
eigen\src/Core/MatrixBase.h(273): error C2719: 'm_epsilon': formal parameter with __declspec(align('16')) won't be aligned

Fixing those two also allows me to compile my code.

Cheers!


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot], rblackwell