cgal5.52 demo编译

头文件

C:\Program Files (x86)\CGAL\include;D:\Cgal\cmake\boost_1_82_0\output\vc14.2-x64\include\boost-1_82;D:\Cgal\CGAL-5.5.2\auxiliary\gmp\include;%(AdditionalIncludeDirectories)
    

<AdditionalLibraryDirectories>D:\Cgal\cmake\boost_1_82_0\output\vc14.2-x64\lib;C:\Program Files (x86)\CGAL\lib;D:\Cgal\CGAL-5.5.2\auxiliary\gmp\lib\;%(AdditionalLibraryDirectories)AdditionalLibraryDirectories>
      <AdditionalDependencies>D:\Cgal\CGAL-5.5.2\auxiliary\gmp\lib\libgmp-10.lib;D:\Cgal\CGAL-5.5.2\auxiliary\gmp\lib\libmpfr-4.lib;%(AdditionalDependencies)AdditionalDependencies>
   

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


#include 
#include 
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 collinear\n";
        break;
    case CGAL::LEFT_TURN:
        std::cout << "make a left turn\n";
        break;
    case CGAL::RIGHT_TURN:
        std::cout << "make a right turn\n";
        break;
    }
    std::cout << " midpoint(p,q) = " << CGAL::midpoint(p, q) << std::endl;
    
    return 0;
}

v140跳出以下错误

error C3249:constexpr”函数的语句或子表达式非法

你可能感兴趣的:(Cgal,c++,开发语言)