Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Build fails on Arch linux #1646

Closed
superbonaci opened this issue Oct 17, 2024 · 4 comments · Fixed by #1648
Closed

[BUG] Build fails on Arch linux #1646

superbonaci opened this issue Oct 17, 2024 · 4 comments · Fixed by #1648

Comments

@superbonaci
Copy link
Contributor

On arch linux:

$ ./build
Running pre-build script...
Obtaining Git commit
Storing variables in file
Commit: cbd8e27fe340d503149c2d1dee06c0790e19d416
Date: 2024-10-17
Stored all in compile_info_real.h
Done.
Trying to compile...
Checking for cargo...
rustc >= MSRV(1.54.0)
Building rust files...
    Finished `release` profile [optimized] target(s) in 0.08s
Building ccextractor
Compiled with errors
../src/lib_ccx/ocr.c: In function 'ocr_rect':
../src/lib_ccx/ocr.c:922:9: error: implicit declaration of function 'mapclut_paletee' [-Wimplicit-function-declaration]
  922 |         mapclut_paletee(palette, alpha, (uint32_t *)rect->data1, rect->nb_colors);
      |         ^~~~~~~~~~~~~~~
@steel-bucket
Copy link

steel-bucket commented Oct 21, 2024

Adding #include "ccx_encoders_spupng.h" at the top of the file /src/lib_ccx/ocr.c makes it compile for Arch Linux. But I have no Idea why it compiles for debian without the aforementioned Change, as I have tried in both.
Here's what I know, the error doesn't come from CMake
At first I thought it did as paru's version is different and newer than apt's version(3.30.5-1 as compared to 3.28.3-1), but changing it doesn't fix it.

@Z-xus
Copy link

Z-xus commented Nov 25, 2024

@steel-bucket Can you please mention the version of clang when using debian? I reproduced and got the same results, I think debian might be using an old version of clang and hence does not treat the warning as an error, described as here: https://www.redhat.com/en/blog/new-warnings-and-errors-clang-16

While my arch system was using latest clang version:

❯ clang --version
clang version 18.1.8
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

@rhymeswithmogul
Copy link
Contributor

Adding #include "ccx_encoders_spupng.h" at the top of the file /src/lib_ccx/ocr.c makes it compile for Arch Linux. But I have no Idea why it compiles for debian without the aforementioned Change, as I have tried in both.

I just tried this on Ubuntu 24.10 and I needed to patch the file, too, even though this is a Debian derivative.

rhymeswithmogul added a commit to rhymeswithmogul/ccextractor that referenced this issue Nov 26, 2024
This commit fixes a compile-time error regarding an implicit declaration
of mapclut_paletee() on some compilers and compiler versions.  Notably,
Arch Linux and Ubuntu 24.10 seem to be affected.

The error resolved is:

```
../src/lib_ccx/ocr.c: In function 'ocr_rect':
../src/lib_ccx/ocr.c:922:9: error: implicit declaration of function 'mapclut_paletee' [-Wimplicit-function-declaration]
  922 |         mapclut_paletee(palette, alpha, (uint32_t *)rect->data1, rect->nb_colors);
      |         ^~~~~~~~~~~~~~~
```

This was resolved by `#include`-ing "ccx_encoders_spupng.h" in the file
src/lib_ccx/ocr.c.  Thanks to GitHub user @steel-bucket for sharing the
fix in this issue's comments.

Fixes: CCExtractor#1646
rhymeswithmogul added a commit to rhymeswithmogul/ccextractor that referenced this issue Nov 26, 2024
@cfsmp3 cfsmp3 closed this as completed in b08c5fa Nov 27, 2024
@superbonaci
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants