最近在学CGAL(Computational Geometry Algorithms Library)计算几何算法库,在练习normal_estimation.cpp
时,出现错误:static assertion failed: Error: no SVD traits,折腾了一整天,找不到相关资料,最后在github上看到解释:You are missing Eigen. It is done by the cmake machinery but if you do it manually, it should be activated with -DCGAL_EIGEN3_ENABLED (and -I eigen include path if not already in the include path).
就是说,错误出在Eigen上,所以将Eigen库的添加进来c_cpp_properties.json
"includePath": [
"${workspaceFolder}/**",
"/usr/include/Eigen"
],
具体路径是自己安装情况而定。
另外,如果提示:CGAL
下的一些头文件找不到:Eigen/Core
或者其他的模块,看看自己Eigen安装路径是不是eigen3/Eigen
这样的,我的就是这样,所有需要eigen3/Eigen
复制到eigen3
同级级目录下:sudo cp -r /usr/include/eigen3/Eigen /usr/include
。注意:路径安装按自己的安装路径写。这是因为CGAL
下的头文件是这样写的:#include <Eigen/Core>
or something。所以,需要给他拷贝出来,不然就要写成这样:#include <eigen3/Eigen/Core>
or something。
搞的我快崩溃了,终于搞定了,出去吃火锅去咯
哦,对了,我是在vscode上弄的,所以看到c_cpp_properties.json
请不要奇怪