idaho777 / computer-graphics-bounding-volume-hierarchy

Computer Graphics Assignment about Bounding Volume Hierarchies
0 stars 0 forks source link

undefined reference error when trying to use Eigen::MatrixBase<Eigen::Vector3d>::cross<Eigen::Vector3d> method. #3

Closed Malavan-Sotheeswaran closed 3 years ago

Malavan-Sotheeswaran commented 3 years ago

/usr/bin/ld: libcore.a(ray_intersect_triangle.cpp.o): in function ray_intersect_triangle(Ray const&, Eigen::Matrix<double, 1, 3, 1, 1, 3> const&, Eigen::Matrix<double, 1, 3, 1, 1, 3> const&, Eigen::Matrix<double, 1, 3, 1, 1, 3> const&, double, double, double&)': ray_intersect_triangle.cpp:(.text+0x27): undefined reference toEigen::MatrixBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> >::cross_product_return_type<Eigen::Matrix<double, 3, 1, 0, 3, 1> >::type Eigen::MatrixBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> >::cross<Eigen::Matrix<double, 3, 1, 0, 3, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> > const&) const'

Followed the instructions to set up(cloned repo, replace cmake file from #1 ) and other Eigen methods like dot work fine but cross is undefined.

idaho777 commented 3 years ago

how are you trying to call cross()? You could try include Eigen/Geometry since it's from that module.

Malavan-Sotheeswaran commented 3 years ago

That solved it, I expected that it would have been included since it is used to implement various intersections but it was not. Thanks for the fix!

idaho777 commented 3 years ago

It’s strange it’s not being included because on my system it gives me no problems. So this should be a temporary and acceptable fix for now.