[BUG] Mac compiling errors #333

Closed
opened 2026-01-29 16:41:16 +00:00 by claunia · 4 comments
Owner

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

  • Is this a regression (did it work before)? [ ] NO | [x] YES - last known working version = 0.84
  • What platform did you use? [ ] Windows - [ ] Linux - [x] Mac
  • What where the used arguments? N/A

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 cmake case, I get

ccextractor/src/lib_ccx/spupng_encoder.h:6:10: fatal error:
'png.h' file not found

Then in the build.command case, I get a linker error instead:

Undefined symbols for architecture x86_64:
"_iconv", referenced from:
__dtvcc_write_row in ccx_decoders_708_output-5cd53d.o
_EPG_DVB_decode_string in ts_tables_epg-4d188e.o
"_iconv_close", referenced from:
_ccx_dtvcc_writer_cleanup in ccx_decoders_708_output-5cd53d.o
_EPG_DVB_decode_string in ts_tables_epg-4d188e.o
"_iconv_open", referenced from:
_ccx_dtvcc_writer_init in ccx_decoders_708_output-5cd53d.o
_EPG_DVB_decode_string in ts_tables_epg-4d188e.o
"_python_extract_g608_grid", referenced from:
_pass_cc_buffer_to_python in ccx_encoders_python-a42d80.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

And finally in the autoconf case, I get yet a different problem:

../src/lib_ccx/ccx_encoders_srt.c:7:10: fatal error:
'ccextractor.h' file not found
#include "ccextractor.h"
^~~~~~~~~~~~~~~
1 error generated.
make: *** [../src/lib_ccx/ccextractor-ccx_encoders_srt.o] Error 1

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 mean cd 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 tesseract
pkg-config --exists --print-errors lept

Finally, 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]):

  • I have read and understood the contributors guide.
  • I have checked that the bug-fix I am reporting can be replicated, or that the feature I am suggesting isn't already present.
  • I have checked that the issue I'm posting isn't already reported.
  • I have checked that the issue I'm porting isn't already solved and no duplicates exist in closed issues and in opened issues
  • I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion.
  • I have used the latest available version of CCExtractor to verify this issue exists.

My familiarity with the project is as follows (check one, eg [X]):

  • I have never used CCExtractor.
  • I have used CCExtractor just a couple of times.
  • I absolutely love CCExtractor, but have not contributed previously.
  • I am an active contributor to CCExtractor.
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** - Is this a regression (did it work before)? [ ] NO | [x] YES - last known working version = 0.84 - What platform did you use? [ ] Windows - [ ] Linux - [x] Mac - What where the used arguments? N/A **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 `cmake` case, I get > ccextractor/src/lib_ccx/spupng_encoder.h:6:10: fatal error: > 'png.h' file not found Then in the` build.command` case, I get a linker error instead: > Undefined symbols for architecture x86_64: > "_iconv", referenced from: > __dtvcc_write_row in ccx_decoders_708_output-5cd53d.o > _EPG_DVB_decode_string in ts_tables_epg-4d188e.o > "_iconv_close", referenced from: > _ccx_dtvcc_writer_cleanup in ccx_decoders_708_output-5cd53d.o > _EPG_DVB_decode_string in ts_tables_epg-4d188e.o > "_iconv_open", referenced from: > _ccx_dtvcc_writer_init in ccx_decoders_708_output-5cd53d.o > _EPG_DVB_decode_string in ts_tables_epg-4d188e.o > "_python_extract_g608_grid", referenced from: > _pass_cc_buffer_to_python in ccx_encoders_python-a42d80.o > ld: symbol(s) not found for architecture x86_64 > clang: error: linker command failed with exit code 1 (use -v to see invocation) And finally in the `autoconf` case, I get yet a different problem: > ../src/lib_ccx/ccx_encoders_srt.c:7:10: fatal error: > 'ccextractor.h' file not found > #include "ccextractor.h" > ^~~~~~~~~~~~~~~ > 1 error generated. > make: *** [../src/lib_ccx/ccextractor-ccx_encoders_srt.o] Error 1 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 mean `cd 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 tesseract` `pkg-config --exists --print-errors lept` Finally, 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]):** - [x] I have read and understood the [contributors guide](https://github.com/CCExtractor/ccextractor/blob/master/.github/CONTRIBUTING.md). - [x] I have checked that the bug-fix I am reporting can be replicated, or that the feature I am suggesting isn't already present. - [x] I have checked that the issue I'm posting isn't already reported. - [x] I have checked that the issue I'm porting isn't already solved and no duplicates exist in [closed issues](https://github.com/CCExtractor/ccextractor/issues?q=is%3Aissue+is%3Aclosed) and in [opened issues](https://github.com/CCExtractor/ccextractor/issues) - [x] I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion. - [x] I have used the latest available version of CCExtractor to verify this issue exists. **My familiarity with the project is as follows (check one, eg [X]):** - [ ] I have never used CCExtractor. - [ ] I have used CCExtractor just a couple of times. - [x] I absolutely love CCExtractor, but have not contributed previously. - [ ] I am an active contributor to CCExtractor.
Author
Owner

@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,

with a clean clone from github, in the cmake case, I get

ccextractor/src/lib_ccx/spupng_encoder.h:6:10: fatal error:
'png.h' file not found

@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 libpng shall 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?

At the start of the compilation section, where it says cd ccextractor/src/, I think you mean cd ccextractor, as otherwise the cmake instruction (cmake ../src/ in the next section doesn't work

You are correct. That's a mistake. Please send a PR to fix it. :)

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

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): 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, > with a clean clone from github, in the cmake case, I get >ccextractor/src/lib_ccx/spupng_encoder.h:6:10: fatal error: >'png.h' file not found @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 libpng` shall 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? >At the start of the compilation section, where it says cd ccextractor/src/, I think you mean cd ccextractor, as otherwise the cmake instruction (cmake ../src/ in the next section doesn't work You are correct. That's a mistake. Please send a PR to fix it. :) >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 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)_ !
Author
Owner

@saurabhshri commented on GitHub (Sep 22, 2017):

[Related : #774]

@saurabhshri commented on GitHub (Sep 22, 2017): [Related : #774]
Author
Owner

@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.h gets 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.

@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.h` gets loaded. Apparently, the [system library is intentionally incompatible](https://stackoverflow.com/questions/40464430/how-to-build-a-static-lib-of-iconv-on-osx-without-libiconv-symbol-names) 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.
Author
Owner

@saurabhshri commented on GitHub (Oct 2, 2017):

@cfsmp3 fixed through #777 & #781 .

@saurabhshri commented on GitHub (Oct 2, 2017): @cfsmp3 fixed through #777 & #781 .
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#333