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

undeclared identifier -YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES

Tags: None
(comma "," separated)
TJKlein
Registered Member
Posts
7
Karma
0
Hi,

I just got eigen 2.0.3 (before used some earlier version) [using VS 2008] and now I keep getting the following error messages:

Error 5 error C2065: 'YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES' : undeclared identifier c:\3rdparty\eigen\eigen\src\Core\Assign.h 403

Error 4 error C2039: 'YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES' : is not a member of 'Eigen::ei_static_assert<condition>' c:\3rdparty\eigen\eigen\src\Core\Assign.h 403


Any idea?

Regards,
Tassilo

Last edited by TJKlein on Mon Jun 29, 2009 12:24 pm, edited 1 time in total.
User avatar
bjacob
Registered Member
Posts
658
Karma
3
YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES is a "static assertion" message. In other words, EIgen is telling you that you made a programming error, mixing matrix of different sizes when it's not allowed. The "undeclared identifier" stuff is just noise as there's no perfect way of doing static assertions in C++98.

I've heard reports that MSVC wasn't very helpful here, giving you only the line number in Assign.h which isn't very helpful. Is this the case for you? If yes, and you really don't know where you mixed matrices of different sizes, you could install GCC 4.4 for windows from here:

http://www.tdragon.net/recentgcc/

and retry compiling (the relevant part of) your code with it. For each such error, GCC will then give you the complete "back trace" all the way to the line your code in your own .cpp file that triggered it.

If MSVC doesn't give this information, and if you find a way to change Eigen/src/Core/util/StaticAssert.h so that it does, we're most interested...


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!
TJKlein
Registered Member
Posts
7
Karma
0
Thanks a lot. This 'undeclared identifier' just confused me pretty much.
bomboze
Registered Member
Posts
12
Karma
0
> I've heard reports that MSVC wasn't very helpful here

Actually it does. I've stumbled into that error too and yes, it points to some .h file in Eigen, but it lists the call stack, the next to last one item in that list is where the error happened. It also lists what sizes of matrices were mixed.

But when you first see it - it seems like an Eigen bug. Maybeyou should look into #error directive, instead of undeclared identifier? http://publib.boulder.ibm.com/infocente ... 9error.htm ?
User avatar
bjacob
Registered Member
Posts
658
Karma
3
bomboze wrote:> I've heard reports that MSVC wasn't very helpful here

Actually it does. I've stumbled into that error too and yes, it points to some .h file in Eigen, but it lists the call stack, the next to last one item in that list is where the error happened. It also lists what sizes of matrices were mixed.


Ah, good to know !

But when you first see it - it seems like an Eigen bug. Maybeyou should look into #error directive, instead of undeclared identifier? http://publib.boulder.ibm.com/infocente ... 9error.htm ?


Unfortunately, #error is not an option here, because it works at preprocessing time while this error can only be detected during the actual compilation. The real solution will come with C++1x that will introduce static_assert.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]