解决cgal中的surface_mesh_deformation,代码copy到别处报错
2015-08-02 15:44
357 查看
我只想说我遇到过多少奇葩的bug啊。。。这么奇葩的错误我竟然能debug出来真是醉醉的
cgal4.5之后,有实现surface_mesh_deformation的example。
1.如何正常编译example?
最好是在编译cgal的时候,cmake中的entry就有,勾选上with_eigen,然后配置include目录即可。
这样以后省事,所以编译cgal的时候,要好好检查外置的库,会用到的都先加上。
如果不想重新编译cgal,在重新用cmake编译surface_mesh_deformation这个example和demo时,选择with_eigen即可。
2.当你正常运行example之后,把代码原样copy到自己的project中,编译会报错TTTTTTT
1>C:\Program Files\CGAL-4.6.1\include\CGAL/Surface_mesh_deformation.h(212): error C2039: 'Matrix' : is not a member of 'CGAL::Default'
1> C:\Program Files\CGAL-4.6.1\include\CGAL/Default.h(31) : see declaration of 'CGAL::Default'
1> ModelDecompoent.cpp(245) : see reference to class template instantiation 'CGAL::Surface_mesh_deformation<HG>' being compiled
1> with
1> [
1> HG=Polyhedron
1> ]
......
一堆错
翻墙说加上#define CGAL_EIGEN3_ENABLED。
因为看CGAL/Surface_mesh_deformation.h代码中:
#if
defined(CGAL_EIGEN3_ENABLED)
#include <CGAL/Eigen_solver_traits.h> // for sparse linear system solver
#include <CGAL/Deformation_Eigen_polar_closest_rotation_traits_3.h> // for 3x3 closest rotation computer
#endif
就是说CGAL_EIGEN3_ENABLED被define了才可以。
然而我加上并没有用!!!
为什么呢?
因为顺序反了=
=
正确的顺序:
#define
CGAL_EIGEN3_ENABLED
#include <CGAL/Surface_mesh_deformation.h>
错误的顺序:
#include
<CGAL/Surface_mesh_deformation.h>
#define CGAL_EIGEN3_ENABLED
//这样子都include完了,define还有什么用。。。
真是奇葩的bug
cgal4.5之后,有实现surface_mesh_deformation的example。
1.如何正常编译example?
最好是在编译cgal的时候,cmake中的entry就有,勾选上with_eigen,然后配置include目录即可。
这样以后省事,所以编译cgal的时候,要好好检查外置的库,会用到的都先加上。
如果不想重新编译cgal,在重新用cmake编译surface_mesh_deformation这个example和demo时,选择with_eigen即可。
2.当你正常运行example之后,把代码原样copy到自己的project中,编译会报错TTTTTTT
1>C:\Program Files\CGAL-4.6.1\include\CGAL/Surface_mesh_deformation.h(212): error C2039: 'Matrix' : is not a member of 'CGAL::Default'
1> C:\Program Files\CGAL-4.6.1\include\CGAL/Default.h(31) : see declaration of 'CGAL::Default'
1> ModelDecompoent.cpp(245) : see reference to class template instantiation 'CGAL::Surface_mesh_deformation<HG>' being compiled
1> with
1> [
1> HG=Polyhedron
1> ]
......
一堆错
翻墙说加上#define CGAL_EIGEN3_ENABLED。
因为看CGAL/Surface_mesh_deformation.h代码中:
#if
defined(CGAL_EIGEN3_ENABLED)
#include <CGAL/Eigen_solver_traits.h> // for sparse linear system solver
#include <CGAL/Deformation_Eigen_polar_closest_rotation_traits_3.h> // for 3x3 closest rotation computer
#endif
就是说CGAL_EIGEN3_ENABLED被define了才可以。
然而我加上并没有用!!!
为什么呢?
因为顺序反了=
=
正确的顺序:
#define
CGAL_EIGEN3_ENABLED
#include <CGAL/Surface_mesh_deformation.h>
错误的顺序:
#include
<CGAL/Surface_mesh_deformation.h>
#define CGAL_EIGEN3_ENABLED
//这样子都include完了,define还有什么用。。。
真是奇葩的bug
相关文章推荐
- java单例模式
- php中的$_SERVER从哪来
- Font: a C++ class
- 用栈实现队列-用队列实现栈
- 编写struts.xml时的提示问题
- php中如何防止CSRF攻击
- Bitmap: a C++ class
- java 集合类结构图 List Set Map 对比
- greenlet代码解读
- Creating an AVI in memory with C++
- AviMemDc: a C++ class
- Python中的元类
- Creating an generated Earth AVI with C++
- java--获取当前时间(Calendar类)
- k最近邻算法(KNN)的简介和python实现
- python正则表达式
- c语言 链表基础
- 用JavaDBF操作(读、写)DBF文件
- JavaWeb 文件上传
- java的反射性能测试