[BUG] Building using CMake with -DWITH_HARDSUBX=ON gives a compilation error. #747

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

Originally created by @ArchitBhonsle on GitHub (Mar 8, 2023).

version: 0.94

In raising this issue, I confirm the following:

  • 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.
  • I have ticked all the boxes in this section and to prove it I'm deleting the section completely to remove boilerplate text.

Necessary information

  • Is this a regression (i.e. did it work before)? Yes, assuming it worked before
  • What platform did you use? Linux
  • What were the used arguments? This was during compilation

Video links

Additional information

As explained in the compilation docs I ran cmake ../src -DWITH_HARDSUBX=ON followed by make and got the compilation failed with the following error. (There are more logs on top but these seem to be the relevant ones)

/home/puipuituipui/Dev/code/Forks/ccextractor/src/lib_ccx/hardsubx.c: In function ‘hardsubx_process_data’:
/home/puipuituipui/Dev/code/Forks/ccextractor/src/lib_ccx/hardsubx.c:16:9: warning: implicit declaration of function ‘av_register_all’ [-Wimplicit-function-declaration]
   16 |         av_register_all();
      |         ^~~~~~~~~~~~~~~
/home/puipuituipui/Dev/code/Forks/ccextractor/src/lib_ccx/hardsubx.c:35:48: error: ‘AVStream’ has no member named ‘codec’
   35 |                 if (ctx->format_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO)
      |                                                ^~
/home/puipuituipui/Dev/code/Forks/ccextractor/src/lib_ccx/hardsubx.c:46:72: error: ‘AVStream’ has no member named ‘codec’
   46 |         ctx->codec_ctx = ctx->format_ctx->streams[ctx->video_stream_id]->codec;
      |                                                                        ^~
/home/puipuituipui/Dev/code/Forks/ccextractor/src/lib_ccx/hardsubx.c:47:20: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   47 |         ctx->codec = avcodec_find_decoder(ctx->codec_ctx->codec_id);
      |                    ^
/home/puipuituipui/Dev/code/Forks/ccextractor/src/lib_ccx/hardsubx.c: In function ‘_init_hardsubx’:
/home/puipuituipui/Dev/code/Forks/ccextractor/src/lib_ccx/hardsubx.c:228:22: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  228 |         char *lang = options->ocrlang;
      |                      ^~~~~~~
/home/puipuituipui/Dev/code/Forks/ccextractor/src/lib_ccx/hardsubx.c: In function ‘hardsubx_process_data’:
/home/puipuituipui/Dev/code/Forks/ccextractor/src/lib_ccx/hardsubx.c:121:1: warning: control reaches end of non-void function [-Wreturn-type]
  121 | }
      | ^
make[2]: *** [lib_ccx/CMakeFiles/ccx.dir/build.make:1994: lib_ccx/CMakeFiles/ccx.dir/hardsubx.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:145: lib_ccx/CMakeFiles/ccx.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
Originally created by @ArchitBhonsle on GitHub (Mar 8, 2023). version: 0.94 # In raising this issue, I confirm the following: - [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. - [x] I have ticked all the boxes in this section and to prove it I'm deleting the section completely to remove boilerplate text. # Necessary information - Is this a regression (i.e. did it work before)? Yes, assuming it worked before - What platform did you use? Linux - What were the used arguments? This was during compilation # Video links # Additional information As explained in the [compilation docs](https://github.com/CCExtractor/ccextractor/blob/master/docs/COMPILATION.MD#using-cmake) I ran `cmake ../src -DWITH_HARDSUBX=ON` followed by `make` and got the compilation failed with the following error. (There are more logs on top but these seem to be the relevant ones) ``` /home/puipuituipui/Dev/code/Forks/ccextractor/src/lib_ccx/hardsubx.c: In function ‘hardsubx_process_data’: /home/puipuituipui/Dev/code/Forks/ccextractor/src/lib_ccx/hardsubx.c:16:9: warning: implicit declaration of function ‘av_register_all’ [-Wimplicit-function-declaration] 16 | av_register_all(); | ^~~~~~~~~~~~~~~ /home/puipuituipui/Dev/code/Forks/ccextractor/src/lib_ccx/hardsubx.c:35:48: error: ‘AVStream’ has no member named ‘codec’ 35 | if (ctx->format_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) | ^~ /home/puipuituipui/Dev/code/Forks/ccextractor/src/lib_ccx/hardsubx.c:46:72: error: ‘AVStream’ has no member named ‘codec’ 46 | ctx->codec_ctx = ctx->format_ctx->streams[ctx->video_stream_id]->codec; | ^~ /home/puipuituipui/Dev/code/Forks/ccextractor/src/lib_ccx/hardsubx.c:47:20: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 47 | ctx->codec = avcodec_find_decoder(ctx->codec_ctx->codec_id); | ^ /home/puipuituipui/Dev/code/Forks/ccextractor/src/lib_ccx/hardsubx.c: In function ‘_init_hardsubx’: /home/puipuituipui/Dev/code/Forks/ccextractor/src/lib_ccx/hardsubx.c:228:22: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 228 | char *lang = options->ocrlang; | ^~~~~~~ /home/puipuituipui/Dev/code/Forks/ccextractor/src/lib_ccx/hardsubx.c: In function ‘hardsubx_process_data’: /home/puipuituipui/Dev/code/Forks/ccextractor/src/lib_ccx/hardsubx.c:121:1: warning: control reaches end of non-void function [-Wreturn-type] 121 | } | ^ make[2]: *** [lib_ccx/CMakeFiles/ccx.dir/build.make:1994: lib_ccx/CMakeFiles/ccx.dir/hardsubx.c.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:145: lib_ccx/CMakeFiles/ccx.dir/all] Error 2 make: *** [Makefile:136: all] Error 2 ```
Author
Owner

@ArchitBhonsle commented on GitHub (Mar 8, 2023):

Using the build_hardsubx script gives the same error message.

@ArchitBhonsle commented on GitHub (Mar 8, 2023): Using the [`build_hardsubx`](https://github.com/CCExtractor/ccextractor/blob/master/linux/build_hardsubx) script gives the same error message.
Author
Owner

@prateekmedia commented on GitHub (Mar 8, 2023):

Being fixed in #1479, duplicate of #1418

@prateekmedia commented on GitHub (Mar 8, 2023): Being fixed in #1479, duplicate of #1418
Author
Owner

@ArchitBhonsle commented on GitHub (Mar 8, 2023):

Sorry for the dupe. Should I close and mark as completed?

@ArchitBhonsle commented on GitHub (Mar 8, 2023): Sorry for the dupe. Should I close and mark as completed?
Author
Owner

@prateekmedia commented on GitHub (Mar 8, 2023):

yes as this is a duplicate

@prateekmedia commented on GitHub (Mar 8, 2023): yes as this is a duplicate
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#747