Open DerekCresswell opened 1 year ago
derek@DLTVMU:~/UofT/Courses/CSC317/CSC317-A3/build$ make Scanning dependencies of target hw2 [ 6%] Building CXX object CMakeFiles/hw2.dir/src/Triangle.cpp.o [ 13%] Linking CXX static library libhw2.a [ 53%] Built target hw2 [ 60%] Linking CXX executable raytracing /usr/bin/ld: libhw2.a(Triangle.cpp.o): in function `Triangle::intersect(Ray const&, double, double&, Eigen::Matrix<double, 3, 1, 0, 3, 1>&) const': Triangle.cpp:(.text+0x306): undefined reference to `Eigen::MatrixBase<Eigen::Matrix<double, 3, 3, 0, 3, 3> >::determinant() const' /usr/bin/ld: Triangle.cpp:(.text+0x528): undefined reference to `Eigen::MatrixBase<Eigen::Matrix<double, 3, 3, 0, 3, 3> >::determinant() const' /usr/bin/ld: Triangle.cpp:(.text+0x72d): undefined reference to `Eigen::MatrixBase<Eigen::Matrix<double, 3, 3, 0, 3, 3> >::determinant() const' /usr/bin/ld: Triangle.cpp:(.text+0x8de): undefined reference to `Eigen::MatrixBase<Eigen::Matrix<double, 3, 3, 0, 3, 3> >::determinant() const' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/raytracing.dir/build.make:160: raytracing] Error 1 make[1]: *** [CMakeFiles/Makefile2:105: CMakeFiles/raytracing.dir/all] Error 2 make: *** [Makefile:84: all] Error 2
I imported my code from A2 and ran make like normal. However, this time it seems like CMake can't find the eigen definitions for matrix determinant. I checked the headers and all the same things are included as in A2.
Added #include <Eigen/Geometry> to my triangle file and it works now. I guess I am just wondering why it would've worked in A2 but not here...
#include <Eigen/Geometry>
I imported my code from A2 and ran make like normal. However, this time it seems like CMake can't find the eigen definitions for matrix determinant. I checked the headers and all the same things are included as in A2.