I am trying to create a project using Tesseract in something other than Visual Studio but there doesn’t seem to be any documentation on how to go about doing this.
The problem I am at now is that file scanutils.cpp calls a function open(char *, int, mode_t) and this isn’t defined anywhere. Is this possibly a Unix function that slipped by or should be located somewhere on my machine?
Thank you.
Edit: I have found that the open function is including using the fcntl.h file in Unix, but the version of it that I have (C++ Builder) does not include the open function. I could just define teh open function in my own file as it is in Unix, but that seems a little reckless. Any suggestions?
open()is a Posix function that usually wraps theopensystem call in conforming systems. This is a rather “low-level” function that is very platform specific.The portable C function that provides the equivalent functionality is
fopen(), in the sense that the result ofopen()is the same asFILE * fp = fopen(...); int fd = fileno(fp);— herefdis the integer returned by the underlyingopen()call.The standard C functions
fwrite()andfread()map to Posix functionsread()andwrite(), by the way.Try to stick with standard C functions and
FILE*data structures as much as possible for maximum portability. If necessary, you can always obtain the Posix file descriptor viafileno().