Bug 440084

Summary: exr.cpp/OpenEXR virtual function tellg error
Product: [Frameworks and Libraries] frameworks-kimageformats Reporter: Kurt Hindenburg <khindenburg>
Component: generalAssignee: Alex Merry <alex.merry>
Status: RESOLVED FIXED    
Severity: normal CC: aacid, kdelibs-bugs-null
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: MacPorts   
OS: macOS   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Kurt Hindenburg 2021-07-20 20:39:13 UTC
This appears to be similar to https://bugs.kde.org/show_bug.cgi?id=439767 but I still get an error even after the patch for that BR.

I build KF5 from the current source.

AppleClang 12.0.5.12050022; openexr @2.3.0


/Volumes/Devel/KDE/src/frameworks/kimageformats/src/imageformats/exr.cpp:47:14: error: virtual function 'tellg' has a different return type ('uint64_t' (aka 'unsigned long long')) than the function it overrides (which has return type 'Imath_2_3::Int64' (aka 'unsigned long'))
    uint64_t tellg() override;
    ~~~~~~~~ ^
/opt/local/include/OpenEXR/ImfIO.h:117:19: note: overridden virtual function is here
    virtual Int64       tellg () = 0;
            ~~~~~       ^
/Volumes/Devel/KDE/src/frameworks/kimageformats/src/imageformats/exr.cpp:48:30: error: non-virtual member function marked 'override' hides virtual member function
    void seekg(uint64_t pos) override;
                             ^
/opt/local/include/OpenEXR/ImfIO.h:125:18: note: hidden overloaded virtual function 'Imf_2_3::IStream::seekg' declared here: type mismatch at 1st parameter ('Imath_2_3::Int64' (aka 'unsigned long') vs 'uint64_t' (aka 'unsigned long long'))
    virtual void        seekg (Int64 pos) = 0;
                        ^
/Volumes/Devel/KDE/src/frameworks/kimageformats/src/imageformats/exr.cpp:170:19: error: variable type 'K_IStream' is an abstract class
        K_IStream istr(device(), QByteArray());
                  ^
/opt/local/include/OpenEXR/ImfIO.h:125:18: note: unimplemented pure virtual method 'seekg' in 'K_IStream'
    virtual void        seekg (Int64 pos) = 0;
                        ^
Comment 1 Albert Astals Cid 2021-07-20 21:02:56 UTC
arg, i fixed openexr 3 and broke 2 :D

Can you confirm if there's a OPENEXR_VERSION_MAJOR defined somewhere in your /opt/local/include/OpenEXR/ ? and which file is it?
Comment 2 Kurt Hindenburg 2021-07-20 21:18:11 UTC
/opt/local/include/OpenEXR/OpenEXRConfig.h:#define OPENEXR_VERSION_MAJOR 2
Comment 3 Albert Astals Cid 2021-07-20 22:05:39 UTC
Can you check if https://invent.kde.org/frameworks/kimageformats/-/merge_requests/34 helps?
Comment 4 Albert Astals Cid 2021-07-20 22:15:03 UTC
Git commit fbeef559b771af16c8e9221ca47691c569b16bb3 by Albert Astals Cid.
Committed on 20/07/2021 at 22:04.
Pushed by aacid into branch 'master'.

exr: Repair compability with openexr2

M  +13   -0    src/imageformats/exr.cpp

https://invent.kde.org/frameworks/kimageformats/commit/fbeef559b771af16c8e9221ca47691c569b16bb3