Bug 439767

Summary: OpenEXR-related compile errors
Product: [Frameworks and Libraries] frameworks-kimageformats Reporter: Yurii Kolesnykov <yurii.kolesnykov>
Component: generalAssignee: Alex Merry <alex.merry>
Status: RESOLVED FIXED    
Severity: critical CC: aacid, kdelibs-bugs-null, yurii.kolesnykov
Priority: NOR    
Version First Reported In: 5.84.0   
Target Milestone: ---   
Platform: Homebrew (macOS)   
OS: macOS   
URL: https://invent.kde.org/packaging/homebrew-kde/-/snippets/1748
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Yurii Kolesnykov 2021-07-12 04:00:12 UTC
SUMMARY
kimageformats build errors if OpenEXR 3.0.5 installed. Reproducible on stable as well as in the latest master.

STEPS TO REPRODUCE
1. Install OpenEXR
2. Try to build kimageformats

OBSERVED RESULT
../src/imageformats/exr.cpp:47:16: error: virtual function 'tellg' has a different return type ('Imf::Int64' (aka 'unsigned long')) than the function it overrides (which has return type 'uint64_t' (aka 'unsigned long long'))
    Imf::Int64 tellg() override;
<...>
../src/imageformats/exr.cpp:48:32: error: non-virtual member function marked 'override' hides virtual member function
    void seekg(Imf::Int64 pos) override;                               ^
<...>
../src/imageformats/exr.cpp:170:19: error: variable type 'K_IStream' is an abstract class
        K_IStream istr(device(), QByteArray());


More details are here: https://invent.kde.org/packaging/homebrew-kde/-/snippets/1748

EXPECTED RESULT
Should build with recent OpenEXR

SOFTWARE/OS VERSIONS
macOS: 11.4 (Big Sur)
KDE Frameworks Version: 5.84.0
Qt Version: 5.15.2
Comment 1 Bug Janitor Service 2021-07-12 18:16:43 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kimageformats/-/merge_requests/33
Comment 2 Albert Astals Cid 2021-07-13 21:04:49 UTC
Git commit 5aa03c12add871996aaa865adf32554e4174ed06 by Albert Astals Cid.
Committed on 12/07/2021 at 18:15.
Pushed by aacid into branch 'master'.

exr: Override the actual function signature

For gcc there's a typedef that makes it work, but seems clang in macos is
not so lucky

M  +4    -4    src/imageformats/exr.cpp

https://invent.kde.org/frameworks/kimageformats/commit/5aa03c12add871996aaa865adf32554e4174ed06