Failed to link the polygon tessellation library poly2tri

I was trying to draw the HalfEdge Data Structure solid with openGL, and I have to subdivision face which may have holes and turn the face to triangles. I use the poly2tri lib. Relate Code is blow.


void Renderer::Poly2Triangles(Face* face)
{
    Plane2D plane(face);
    std::vector<p2t::Point*> all_points;
    std::vector<p2t::Point*> out_points;
    std::vector<p2t::Point*> in_points;

    //outter loop
    Loop* outerLoop = face->fLoops;
    while (outerLoop->IsInnerLoop) outerLoop = outerLoop->lNext;
    glm::vec3 firstEdge = (outerLoop->lHEdge->destination->Pos).position - (outerLoop->lHEdge->origin->Pos).position;
    glm::vec3 secondEdge = (outerLoop->lHEdge->Next->destination->Pos).position - (outerLoop->lHEdge->Next->origin->Pos).position;
    glm::vec3 norm = glm::normalize(glm::cross(firstEdge, secondEdge));
    HalfEdge* he = outerLoop->lHEdge;
    do {
        glm::vec2 p = plane.Space3DToPlane2D((he->origin->Pos).position);
        p2t::Point* point = new p2t::Point(p.x, p.y);
        all_points.push_back(point);
        out_points.push_back(point);
        he = he->Next;
    } while (he != outerLoop->lHEdge);
    p2t::CDT cdt(std::move(out_points)); //-----------first link error here--------------- 


    //inner loop
    Loop* innerLoop = face->fLoops;
    do {
        if (!(innerLoop->IsInnerLoop)) {
            innerLoop = innerLoop->lNext;
            continue;
        }

        HalfEdge* he = innerLoop->lHEdge;
        do {
            glm::vec2 p = plane.Space3DToPlane2D((he->origin->Pos).position);
            p2t::Point* point = new p2t::Point(p.x, p.y);
            in_points.push_back(point);
            all_points.push_back(point);
            he = he->Next;
        } while (he != innerLoop->lHEdge);

        cdt.AddHole(std::move(in_points));//----------------link error-------------
        innerLoop = innerLoop->lNext;
    } while (innerLoop != face->fLoops);

    cdt.Triangulate();//-----------------------link error------------------------ 


    auto tris = cdt.GetTriangles();//------------------------link error---------------------- 
    for (auto tri : tris) {
        Triangle triangle;
        for (int i = 0; i < 3; i++) {
            auto _p = tri->GetPoint(i);
            triangle.vertex[i] = plane.Plane2DToSpace3D(glm::vec2(_p->x, _p->y));
            triangle.normal[i] = norm;
        }
        triangles.push_back(triangle);
    }
    for (auto p : all_points)
        delete p;
}

When I try to run it, it shows five link error:

  • Renderer.obj : error LNK2019: 无法解析的外部符号 “public: __thiscall p2t::CDT::CDT(class std::vector<struct p2t::Point *,class std::allocator<struct p2t::Point *> >)” (??0CDT@p2t@@QAE@V?$vector@PAUPoint@p2t@@V?$allocator@PAUPoint@p2t@@@std@@@std@@@Z),函数 “private: void __thiscall Renderer::Poly2Triangles(class Face *)” (?Poly2Triangles@Renderer@@AAEXPAVFace@@@Z) 中引用了该符号

  • 1>Renderer.obj : error LNK2019: 无法解析的外部符号 “public: __thiscall p2t::CDT::~CDT(void)” (??1CDT@p2t@@QAE@XZ),函数 “private: void __thiscall Renderer::Poly2Triangles(class Face *)” (?Poly2Triangles@Renderer@@AAEXPAVFace@@@Z) 中引用了该符号

  • 1>Renderer.obj : error LNK2019: 无法解析的外部符号 “public: void __thiscall p2t::CDT::AddHole(class std::vector<struct p2t::Point *,class std::allocator<struct p2t::Point *> >)” (?AddHole@CDT@p2t@@QAEXV?$vector@PAUPoint@p2t@@V?$allocator@PAUPoint@p2t@@@std@@@std@@@Z),函数 “private: void __thiscall Renderer::Poly2Triangles(class Face *)” (?Poly2Triangles@Renderer@@AAEXPAVFace@@@Z) 中引用了该符号

  • 1>Renderer.obj : error LNK2019: 无法解析的外部符号 “public: void __thiscall p2t::CDT::Triangulate(void)” (?Triangulate@CDT@p2t@@QAEXXZ),函数 “private: void __thiscall Renderer::Poly2Triangles(class Face *)” (?Poly2Triangles@Renderer@@AAEXPAVFace@@@Z) 中引用了该符号

  • 1>Renderer.obj : error LNK2019: 无法解析的外部符号 “public: class std::vector<class p2t::Triangle *,class std::allocator<class p2t::Triangle *> > __thiscall p2t::CDT::GetTriangles(void)” (?GetTriangles@CDT@p2t@@QAE?AV?$vector@PAVTriangle@p2t@@V?$allocator@PAVTriangle@p2t@@@std@@@std@@XZ),函数 “private: void __thiscall Renderer::Poly2Triangles(class Face *)” (?Poly2Triangles@Renderer@@AAEXPAVFace@@@Z) 中引用了该符号

just all the p2t::CDT class member was unresolved external symbol: CDT、~CDT、CDT::AddHole、 CDT::Triangulate、CDT::GetTriangles

I use VS2022 build this project, I add the poly2tri header file to the include file path in project properties. the file structure is blow and I just #include "poly2tri.h". it actually pass the compile.
enter image description here

I have no idea what’s going on, I want to find errors and correct them. Or I’m happy to know other way to subdivision polygon to triangles.

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật