我正在编写一个 C 工具来调用 C++ API。我有以下代码:
Boxa *tess_get_text_lines(tess_api_t *api, const bool raw_image,
const int raw_padding, Pixa** pixa, int **blockids,
int **paraids)
{
return api->tess_api->GetTextlines(raw_image, raw_padding, pixa, blockids,
paraids);
}
我收到以下 G++ 错误:
$ ./build_so.sh
tesseract.cpp: In function ‘Boxa* tess_get_text_lines(tess_api_t*, bool, int, Pixa**, int**, int**)’:
tesseract.cpp:172:47: error: no matching function for call to ‘tesseract::TessBaseAPI::GetTextlines(const bool&, const int&, Pixa**&, int**&, int**&)’
tesseract.cpp:172:47: note: candidate is:
In file included from tesseract.cpp:3:0:
/usr/include/tesseract/baseapi.h:376:9: note: Boxa* tesseract::TessBaseAPI::GetTextlines(Pixa**, int**)
/usr/include/tesseract/baseapi.h:376:9: note: candidate expects 2 arguments, 5 provided
它与我对正确过载的调用不匹配。作为参考,以下是被调用方法的可用重载:
Boxa* GetTextlines(const bool raw_image, const int raw_padding,
Pixa** pixa, int** blockids, int** paraids);
Boxa* GetTextlines(Pixa** pixa, int** blockids);
为什么我的电话被翻译成“GetTextlines(const bool&, const int&, Pixa* &, int *&, int**&)”(所有的 by-ref'ing)?
谢谢。