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

Compile error in MatrixBase.h

Tags: None
(comma "," separated)
vernal
Registered Member
Posts
37
Karma
0

Compile error in MatrixBase.h

Thu Apr 07, 2011 7:47 am
Hi all,

MSVC 10 SP1 gives me a compile error in MatrixBase.h in line 253 when I try to compile the PCL (PointCloudLibrary).
error C2082: redefinition of formal parameter 'n' in
\eigen\src\Core\MatrixBase.h

The comment line above the offending line also says "huuuge hack"... perhaps it is related ;)

Cheers
vernal
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Compile error in MatrixBase.h

Thu Apr 07, 2011 11:49 am
Hi,

does MSVC gives you more information as I don't understand this error.
vernal
Registered Member
Posts
37
Karma
0

Re: Compile error in MatrixBase.h

Fri Apr 08, 2011 7:43 am
I can tell you that the error goes away by simply renaming that variable n. (Although I don't know if I break something with it as I don't know much about templates).

The error is described in a bit more detail here:
http://msdn.microsoft.com/en-us/library/k4h61sx8(v=VS.90).aspx
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Compile error in MatrixBase.h

Mon Apr 18, 2011 7:35 am
(sorry for the delay)

ok, the problem is that here n is a template variable and it is not redefined anywhere. Actually it is even not used. So you say that for instance rewriting the line 253 as:

template<template<typename T, int N> class U>

with a upper case N, fixes your issue? That just does not make sense to me. Bit if that's all you need I'm ok to commit such a change.
Andre
Registered Member
Posts
90
Karma
1

Re: Compile error in MatrixBase.h

Mon Apr 18, 2011 8:24 am
Isn't there a typename or type or class missing after that template definition?


'And all those exclamation marks, you notice? Five? A sure sign of someone who wears his underpants on his head.' ~Terry Pratchett

'It's funny. All you have to do is say something nobody understands and they'll do practically anything you want them to.' ~J.D. Salinger
jpicksley
Registered Member
Posts
7
Karma
0

Re: Compile error in MatrixBase.h

Thu Sep 13, 2012 4:56 pm
For information, I've just had this exact problem and resolved it in exactly the same way. I am compiling Eigen 3.1.1 into my own code and am using the linearRegression class template. I have therefore defined EIGEN2_SUPPORT as a preprocessor definition.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Compile error in MatrixBase.h

Fri Sep 14, 2012 7:57 am
OK, still very strange, anyway:

https://bitbucket.org/eigen/eigen/chang ... 483956b8d/
changeset: 753483956b8d
user: ggael
date: 2012-09-14 09:54:56
summary: workaround weird compilation error with MSVC

https://bitbucket.org/eigen/eigen/chang ... c6bfc83dc/
changeset: 2d7c6bfc83dc
branch: 3.1
user: ggael
date: 2012-09-14 09:54:56
summary: workaround weird compilation error with MSVC
(transplanted from 753483956b8d587f9d2181b0cb7331d034762ea5)


Bookmarks



Who is online

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