'CGAL :: Surface_mesh_parameterization :: get_error_message(int)'的多重定义

时间:2018-04-09 12:26:22

标签: cgal

我能够轻松地使用给定示例的CGAL表面网格参数化。这意味着CGAL已正确安装并且功能正常。 重现错误的方法:

  1. 创建一个空的主文件
  2. 创建一个对CGAL square_border_parametrize.cpp
  3. 进行适当修改的类文件
  4. 在我执行cmake .make之后,这就是输出
    
    Scanning dependencies of target Main
    [ 33%] Building CXX object CMakeFiles/Main.dir/SBP.cpp.o
    :0:15: warning: missing whitespace after the macro name
    :0:15: warning: missing whitespace after the macro name
    [ 66%] Building CXX object CMakeFiles/Main.dir/main.cpp.o
    :0:15: warning: missing whitespace after the macro name
    :0:15: warning: missing whitespace after the macro name
    [100%] Linking CXX executable Main
    CMakeFiles/Main.dir/main.cpp.o: In function _mm_getcsr()':
    /usr/local/include/CGAL/Interval_nt.h:202: multiple definition ofCGAL::Surface_mesh_parameterization::get_error_message(int)'
    CMakeFiles/Main.dir/SBP.cpp.o:/usr/local/include/CGAL/Surface_mesh_parameterization/Error_code.h:53: first defined here
    collect2: error: ld returned 1 exit status
    CMakeFiles/Main.dir/build.make:450: recipe for target 'Main' failed
    make[2]: * [Main] Error 1
    CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/Main.dir/all' failed
    make[1]: * [CMakeFiles/Main.dir/all] Error 2
    Makefile:140: recipe for target 'all' failed
    make: *** [all] Error 2
    
  5. 我无法找到_mm_getcsr()': /usr/local/include/CGAL/Interval_nt.h:202: multiple definition of的任何多重定义。我的CMakeLists.txt文件如下所示:

    CGAL::Surface_mesh_parameterization::get_error_message(int)

1 个答案:

答案 0 :(得分:0)

快速修复:在inline前面的文件include / CGAL / Surface_mesh_parameterization / Error_code.h中写const char* get_error_message(int error_code)

此修复程序位于此pull request中,现在已合并到CGAL-4.12中。