cgal5.52 demo编译

2023-07-08 14:40:08 浏览数 (2)

头文件

代码语言:javascript复制
<AdditionalIncludeDirectories>C:Program Files (x86)CGALinclude;D:Cgalcmakeboost_1_82_0outputvc14.2-x64includeboost-1_82;D:CgalCGAL-5.5.2auxiliarygmpinclude;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

代码语言:javascript复制
<AdditionalLibraryDirectories>D:Cgalcmakeboost_1_82_0outputvc14.2-x64lib;C:Program Files (x86)CGALlib;D:CgalCGAL-5.5.2auxiliarygmplib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
      <AdditionalDependencies>D:CgalCGAL-5.5.2auxiliarygmpliblibgmp-10.lib;D:CgalCGAL-5.5.2auxiliarygmpliblibmpfr-4.lib;%(AdditionalDependencies)</AdditionalDependencies>

这样就可以;了,5.5版本不用编译直接用 boost库需要编译一下,但是好像v142,v141可以用一个版本的文件 demo

代码语言:javascript复制
#include <iostream>
#include <CGAL/Simple_cartesian.h>
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_2 Point_2;
typedef Kernel::Segment_2 Segment_2;
int main()
{
    std::cout << "Hello World!n";
    Point_2 p(1, 1), q(10, 10);
    std::cout << "p = " << p << std::endl;
    std::cout << "q = " << q.x() << " " << q.y() << std::endl;
    std::cout << "sqdist(p,q) = "
        << CGAL::squared_distance(p, q) << std::endl;
    Segment_2 s(p, q);
    Point_2 m(5, 9);
    std::cout << "m = " << m << std::endl;
    std::cout << "sqdist(Segment_2(p,q), m) = "
        << CGAL::squared_distance(s, m) << std::endl;
    std::cout << "p, q, and m ";
    switch (CGAL::orientation(p, q, m)) {
    case CGAL::COLLINEAR:
        std::cout << "are collinearn";
        break;
    case CGAL::LEFT_TURN:
        std::cout << "make a left turnn";
        break;
    case CGAL::RIGHT_TURN:
        std::cout << "make a right turnn";
        break;
    }
    std::cout << " midpoint(p,q) = " << CGAL::midpoint(p, q) << std::endl;
    
    return 0;
}

v140跳出以下错误

代码语言:javascript复制
error C3249: “constexpr”函数的语句或子表达式非法

0 人点赞