mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-04 05:44:53 +00:00
[BUG] Mac compiling errors #333
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mackworth on GitHub (Sep 21, 2017).
CCExtractor version (using the --version parameter preferably) : 0.86
(Please see required affirmations at end of submittal...)
Necessary information
Additional information
When I try to compile on the Mac (10.12.6; Xcode 9.0), following the instructions in the README and with a clean clone from github, in the
cmakecase, I getThen in the
build.commandcase, I get a linker error instead:And finally in the
autoconfcase, I get yet a different problem:As an aside, while ensuring I was following the README file exactly, I noticed one problem and one suggestion. At the start of the compilation section, where it says
cd ccextractor/src/, I think you meancd ccextractor, as otherwise the cmake instruction (cmake ../src/in the next section doesn't work (and one usually doesn't want a build directory inside one's src directory).Secondly, in the Mac-specific section, where it says
Make sure tesseract and leptonica are detected by pkg-config, it would be nice to give the relevant commands (for those of us unfamiliar with pkg-config). It took me a little searching, but I figured out they should be:pkg-config --exists --print-errors tesseractpkg-config --exists --print-errors leptFinally, with all the good work done on integrating the build process, the file README.MAC.TXT no longer seems necessary.
Any suggestions on getting it to compile? (BTW, while I'm supposed to choose Bug, Proposal, or Question (and compilation doesn't seem to work as suggested), it seems highly likely to me that I'm just doing something wrong.)
In raising this issue, I confirm the following (please check boxes, eg [X]):
My familiarity with the project is as follows (check one, eg [X]):
@saurabhshri commented on GitHub (Sep 22, 2017):
Hello @mackworth ! There are so many build methods, and when any critical change is introduced, it's needed to be covered across all build scripts. A recent such change was made and it was not reflected across all the build scripts, hence the linker errors.
I think it's worth editing the contributor's guide to remind them to make these changes whenever they push code which affects installation and compilation.
For mac,
@canihavesomecoffee also reported me the same error, that PkgConfig test doesn't run successfully on all devices and hence it doesn't try to use supplied libpng installation is missing.
Please install
libpng(brew install libpngshall do it) and make sure it is in OS's path. Alternatively, you may edit the cmake file to always use the supplied libpng (relevant lines : https://github.com/CCExtractor/ccextractor/blob/master/src/CMakeLists.txt#L80 ).@cfsmp3 I think we should skip the test altogether, and since libpng is required in every platform, we can directly use the supplied ones. We currently redundantly check if it's present for all OS. What are your thoughts?
You are correct. That's a mistake. Please send a PR to fix it. :)
PR is welcomed! ;)
Thanks for reporting, and welcome to CCExtractor! Also, we generally hangout on Slack, have you joined it already? If not, invite yourself from here : (https://www.ccextractor.org/doku.php?id=public:general:support) !
@saurabhshri commented on GitHub (Sep 22, 2017):
[Related : #774]
@mackworth commented on GitHub (Sep 22, 2017):
So, that took me down quite a rabbit hole.
First problem, the build.command file does not compile the API file extractor.h.
Secondly, I did have PNG downloaded; I think it had the same problem as iconv below, but I changed the cmakelists.txt as you suggested, and it fixed it.
Third, when you compile with OCR, loading those libraries changes which
iconv.hgets loaded. Apparently, the system library is intentionally incompatible with the one loaded by open-source packages. So, I modified the build.command file to take OCR as an option. Without it , it compiles fine.For the OCR option, as a pkg-config file is not created for iconv, I couldn't just add that reference. I did get it to compile with OCR, but only by manually entering the macports location where the library is stored.
I'll do a pull request as it's much closer now; happy to change it, if someone more knowledgable than I about build systems can tell me how to make it work better.
@saurabhshri commented on GitHub (Oct 2, 2017):
@cfsmp3 fixed through #777 & #781 .