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

Compile Error with Scaling<double> and gcc 4.4.6

Tags: None
(comma "," separated)
twood
Registered Member
Posts
17
Karma
0
Hi,
I have a project using Eigen that successfully compiles under Clang using the C++11 standard. I've been asked by someone to try and get this project working with gcc as well, the version available is 4.4.6 which supports a -std=c++0x switch but not -std=c++11. It's currently failing to compile the following line:
Code: Select all
Affine3d S(Scaling<double>(dim1, dim2, dim3));

with the following error message:
Code: Select all
eigen/Eigen/src/Core/DenseBase.h: In instantiation of Eigen::DenseBase<double>:
eigen/Eigen/src/Code/MatrixBase.h:50: instantiated from Eigen::MatrixBase<double>
MyFile.cpp:1316: instantiated from here
eigen/Eigen/src/Core/DenseBase.h:38: error: invalid use of incomplete type struct Eigen::internal::traits<double>

(Some file names changed for clarity).

Does anyone have any idea what the problem is? Similar issues with incomplete types in Eigen seem to be to do with missing includes, but Eigen/Geometry is included and that seems to include all the relevant files I can think of.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
You should not explicitly specify the template parameter of the Scaling function because there are many template overload. Simply do

Affine3d S(Scaling(dim1, dim2, dim3));

or if dim* are not doubles:

Affine3d S(Scaling(double(dim1), double(dim2), double(dim3)));


Bookmarks



Who is online

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