Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

problem when adding openexr in kimageformat as plugin in QT



  • When I compile the imageformat it finds all the libraries but it does not give me the option to include the open exr. I need this to open these image formats on qt.

    0_1544744930358_cea5fcef-e5e1-4d44-8b2b-c403787bea72.png


  • Qt Champions 2017

    Are you trying to copy this under plugins/imageformats directory ? is this plugin developed as Qt image plugin (inherited from QImageIOPlugin) ?



  • Just add the path to the libraries to the CMAKE_PREFIX_PATH argument or to the PATH environmental variable



  • @VRonin @dheerendra I've been taking a look, I've added the openexr lib but it did not work, it's giving this error

    0_1544835949050_66aa81f5-78bb-4738-90d4-dcca1f7d193f-image.png

    [ 1%] Automatic MOC for target kimg_exr
    [ 1%] Built target kimg_exr_autogen
    [ 3%] Building CXX object src/imageformats/CMakeFiles/kimg_exr.dir/exr.cpp.obj
    [ 5%] Building CXX object src/imageformats/CMakeFiles/kimg_exr.dir/kimg_exr_autogen/mocs_compilation.cpp.obj
    [ 6%] Linking CXX shared module ....\bin\imageformats\kimg_exr.dll
    CMakeFiles\kimg_exr.dir/objects.a(exr.cpp.obj): In function K_IStream::read(char*, int)': C:/Git/kimageformats/src/imageformats/exr.cpp:61: undefined reference toIex_2_3::throwErrnoExc(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
    CMakeFiles\kimg_exr.dir/objects.a(exr.cpp.obj): In function EXRHandler::read(QImage*)': C:/Git/kimageformats/src/imageformats/exr.cpp:169: undefined reference toImf_2_3::globalThreadCount()'
    C:/Git/kimageformats/src/imageformats/exr.cpp:169: undefined reference to Imf_2_3::RgbaInputFile::RgbaInputFile(Imf_2_3::IStream&, int)' C:/Git/kimageformats/src/imageformats/exr.cpp:170: undefined reference toImf_2_3::RgbaInputFile::dataWindow() const'
    C:/Git/kimageformats/src/imageformats/exr.cpp:178: undefined reference to Imf_2_3::RgbaInputFile::setFrameBuffer(Imf_2_3::Rgba*, unsigned long long, unsigned long long)' C:/Git/kimageformats/src/imageformats/exr.cpp:179: undefined reference toImf_2_3::RgbaInputFile::readPixels(int, int)'C:/Git/kimageformats/src/imageformats/exr.cpp:169: undefined reference to Imf_2_3::RgbaInputFile::~RgbaInputFile()' C:/Git/kimageformats/src/imageformats/exr.cpp:169: undefined reference toImf_2_3::RgbaInputFile::~RgbaInputFile()'
    CMakeFiles\kimg_exr.dir/objects.a(exr.cpp.obj): In function EXRHandler::canRead(QIODevice*)': C:/Git/kimageformats/src/imageformats/exr.cpp:212: undefined reference toImf_2_3::isImfMagic(char const*)'
    CMakeFiles\kimg_exr.dir/objects.a(exr.cpp.obj): In function Iex_2_3::InputExc::InputExc(char const*)': C:/PROGRA~1/OpenEXR/include/OpenEXR/IexBaseExc.h:156: undefined reference toIex_2_3::BaseExc::BaseExc(char const*)'
    CMakeFiles\kimg_exr.dir/objects.a(exr.cpp.obj): In function Iex_2_3::InputExc::~InputExc()': C:/PROGRA~1/OpenEXR/include/OpenEXR/IexBaseExc.h:156: undefined reference toIex_2_3::BaseExc::~BaseExc()'
    CMakeFiles\kimg_exr.dir/objects.a(exr.cpp.obj): In function K_IStream::K_IStream(QIODevice*, QByteArray const&)': C:/Git/kimageformats/src/imageformats/exr.cpp:40: undefined reference toImf_2_3::IStream::IStream(char const*)'
    CMakeFiles\kimg_exr.dir/objects.a(exr.cpp.obj):exr.cpp:(.rdata$_ZTV9K_IStream[_ZTV9K_IStream]+0x20): undefined reference to Imf_2_3::IStream::isMemoryMapped() const' CMakeFiles\kimg_exr.dir/objects.a(exr.cpp.obj):exr.cpp:(.rdata$_ZTV9K_IStream[_ZTV9K_IStream]+0x30): undefined reference toImf_2_3::IStream::readMemoryMapped(int)'
    CMakeFiles\kimg_exr.dir/objects.a(exr.cpp.obj): In function K_IStream::~K_IStream()': C:/Git/kimageformats/src/imageformats/exr.cpp:36: undefined reference toImf_2_3::IStream::~IStream()'
    CMakeFiles\kimg_exr.dir/objects.a(exr.cpp.obj):exr.cpp:(.rdata$_ZTVN7Iex_2_38InputExcE[_ZTVN7Iex_2_38InputExcE]+0x20): undefined reference to Iex_2_3::BaseExc::what() const' CMakeFiles\kimg_exr.dir/objects.a(exr.cpp.obj):exr.cpp:(.rdata$.refptr._ZN4half8_toFloatE[.refptr._ZN4half8_toFloatE]+0x0): undefined reference tohalf::_toFloat'
    collect2.exe: error: ld returned 1 exit status
    mingw32-make.exe[2]: *** [src\imageformats\CMakeFiles\kimg_exr.dir\build.make:107: bin/imageformats/kimg_exr.dll] Error 1
    mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:200: src/imageformats/CMakeFiles/kimg_exr.dir/all] Error 2
    mingw32-make.exe: *** [Makefile:140: all] Error 2


  • Lifetime Qt Champion

    Isn't this question a bit of a duplicate about what we are talking about here ?


Log in to reply