dilevin / computer-graphics-bounding-volume-hierarchy

Computer Graphics Assignment about Bounding Volume Hierarchies
6 stars 5 forks source link

use of undefined type error - Eigen #40

Closed NPTP closed 4 years ago

NPTP commented 4 years ago

Hi,

On Windows here.

I'm using almost the exact same code I used in a previous assignment for ray-triangle intersection (ray_intersect_triangle.cpp), but for some reason, I get an error when trying to do a matrix solve. The following line of code:

Eigen::Vector3d x = A_matrix.colPivHouseholderQr().solve(B_vector);

is referenced when VS Studio 2019 gives me this build error: use of undefined type 'Eigen::ColPivHouseholderQR<Eigen::Matrix<double,3,3,0,3,3>>

(note: I get a similar error trying to build on the CDF linux machines)

What's strange is that getting rid of this line and debugging around it shows it looks like things should work, but it just doesn't... and the whole ray_intersect_triangle() function is basically exactly the same code I used in A2 & A3 (which ran on Windows & Linux fine), the only difference is translating the row vectors into column vectors and adding a check to include max_t.

Any ideas what's going on? Thanks!

honglin-c commented 4 years ago

Do you include the Eigen QR module using #include <Eigen/QR> in your cpp file?

NPTP commented 4 years ago

That worked! A missing include was my first suspicion, but I didn't see <Eigen/QR> included anywhere in my .cpp or attached .h files in the last assignment where I used the same function, so I thought that function must be part of <Eigen/Core>. I guess it must have been included somewhere and I must have missed, maybe through several layers of headers or something? In any case, thank you!