Tworzę dokument PDF z wykorzystaniem biblioteki libharu napisanej w C.
/*definicja wektora*/
std::vector<std::shared_ptr<HPDF_Page> > pages;
/*stworzenie dokumentu*/
HPDF_Doc documentPdf = HPDF_New(error_handler, 0);
/*dodanie strony do dokumentu*/
/*HPDF_Page HPDF_AddPage (HPDF_Doc pdf);*/
/*typedef HPDF_Dict HPDF_Page;*/
/*typedef struct _HPDF_Dict_Rec *HPDF_Dict;*/
pages.push_back(std::shared_ptr<HPDF_Page>(HPDF_AddPage(documentPdf)))
Przy próbie stworzenia shared_ptr i dodania go do vektora wywala mi bład:
Error 1 error C2664: 'void std::_Ptr_base<_Ty>::_Reset0(_Ty *,std::_Ref_count_base *)' : cannot convert argument 1 from '_HPDF_Dict_Rec *' to 'HPDF_Page *