无法在Cygwin中制作CGAL示例

时间:2016-12-22 00:49:27

标签: c++ windows cygwin cgal

我无法在Cygwin下构建一些CGAL示例。所有失败的示例都共享类似的错误消息。

非常感谢任何指导。

以下是我遵循的步骤以及“make”中的示例错误。

Cygwin(x64)在Windows 7下安装到d:\ cygwin64。

https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-4.9/CGAL-4.9.zip下载的CGAL来源 并解压缩到D:\ cygwin64 \ usr \ CGAL-4.9

CGAL所需的所有库都是通过Cygwin x64设置安装的。

初始cmake:


    cd /usr/CGAL-4.9
    cmake -DCMAKE_LEGACY_CYGWIN_WIN32=1 -DWITH_CGAL_Qt5=OFF -DWITH_examples=ON  .

无法配置一些示例,其中包括 mesh 和Scale_space_reconstruction_3示例。


    cd /usr/CGAL-4.9
    make
    make examples

前几个示例已成功创建。例如,


    PATH=/usr/local/bin:/usr/bin:/bin:/lib:/usr/CGAL-4.9/bin:/usr/CGAL-4.9/lib
    cd /usr/CGAL-4.9/examples/AABB_tree
    ./AABB_triangle_3_example.exe
    3 intersections(s) with ray query
    closest point is: 0.333333 0.333333 0.333333
    squared distance: 8.33333

后面的示例演示了一些唠叨问题,该问题出现在许多示例中:


    cd /usr/CGAL-4.9/examples/Snap_rounding_2/
    cmake -DCGAL_DIR=/usr/CGAL-4.9 .
    make

    Scanning dependencies of target snap_rounding
    [ 16%] Building CXX object CMakeFiles/snap_rounding.dir/snap_rounding.cpp.o
    In file included from /usr/CGAL-4.9/include/CGAL/CORE/CoreDefs.h:41:0,
                     from /usr/CGAL-4.9/include/CGAL/CORE/BigFloatRep.h:40,
                     from /usr/CGAL-4.9/include/CGAL/CORE/BigFloat.h:38,
                     from /usr/CGAL-4.9/include/CGAL/CORE_BigFloat.h:27,
                     from /usr/CGAL-4.9/include/CGAL/CORE_arithmetic_kernel.h:39,
                     from /usr/CGAL-4.9/include/CGAL/Arithmetic_kernel.h:51,
                     from /usr/CGAL-4.9/include/CGAL/Arr_rational_function_traits_2.h:28,
                     from /usr/CGAL-4.9/include/CGAL/Sweep_line_2_algorithms.h:37,
                     from /usr/CGAL-4.9/include/CGAL/Snap_rounding_2.h:28,
                     from /usr/CGAL-4.9/examples/Snap_rounding_2/snap_rounding.cpp: :
    /usr/CGAL-4.9/include/CGAL/CORE/extLong.h:171:8: warning: ‘CORE::extLong::extLong(int)’ redeclared without dllimport attribute after being referenced with dll linkage
     inline extLong::extLong(int i) : val(i), flag(0) {
            ^
    /usr/CGAL-4.9/include/CGAL/CORE/extLong.h:292:13: warning: ‘bool CORE::extLong::isNaN() const’ redeclared without dllimport attribute after being referenced with dll linkage
     inline bool extLong::isNaN() const {

这里省略了许多类似的错误。

感谢!!!

1 个答案:

答案 0 :(得分:0)

由于您未报告的错误可能是由于错误的导入指令,您可以尝试以下操作:

include/CGAL/export/helpers.h 替换

#  if defined(_WIN32) || defined(__CYGWIN__)
with
#  if defined(_WIN32)

然后使用

进行构建
cmake -DWITH_CGAL_Qt5=OFF -DWITH_examples=ON

因为我看到构建工作效果更好(20%完成了我们的工作并仍在继续)