msvcr120.dll 处的无效参数错误(Building Tesseract Lib in 64bit Windows)

An invalid parameter error at msvcr120.dll (Building Tesseract Lib in 64bit Windows)

我已经在Tesseract论坛上提出了问题,但是是否能找到错误的线索,我在这个论坛上再次提出这个问题。因为这是我最喜欢的解决问题的论坛。

我有一个与 tesseract 库有关的问题。

问题出在 libtiff leptonica 库中使用的组件之一。

我完全按照描述的做了 here

正在为我的 64 位 windows 构建 libtiff。

C:\LIBTIFF\LIBTIFF> nmake /f makefile.vc
C:\LIBTIFF\LIBTIFF> cd ..\tools
C:\LIBTIFF\TOOLS> nmake /f makefile.vc

构建正常。 使用 tiff 库,我为 64 位 windows 构建了 leptonica 库和 tessearact 库。 一旦我 运行 我的应用程序使用 tesseract lib,我在 tiff lib 中出错,错误是

"Unhandled exception at 0x00007FFA966FDD27 (msvcr120.dll) in TessarActOCR_test.exe: An invalid parameter was passed to a function that considers invalid parameters fatal."

错误发生在以下函数的 lseek 处。函数位于tiffio.c

static TIFF *
fopenTiff(FILE        *fp,tif_win32.c
          const char  *modestring)
{
l_int32  fd;

    PROCNAME("fopenTiff");

    if (!fp)
        return (TIFF *)ERROR_PTR("stream not opened", procName, NULL);
    if (!modestring)
        return (TIFF *)ERROR_PTR("modestring not defined", procName, NULL);

    if ((fd = fileno(fp)) < 0)
        return (TIFF *)ERROR_PTR("invalid file descriptor", procName, NULL);
    lseek(fd, 0, SEEK_SET);

    return TIFFFdOpen(fd, "TIFFstream", modestring);
}

这个错误可能有什么问题?

现在我解决了所有问题,并且 tesseract lib 可以在我的 64 位电脑和项目上运行。对我来说,解决方案是在准备依赖项期间按照此 link 中的讨论逐步进行。然后构建 leptonica lib,然后 link to tesseract 构建 tesseract lib。现在一切正常。