Problem compiling luminancehdr on mac OS X 12

I git cloned commit 9d81d9906d2b7daa0e5f1a23738ec6523723a478
used gcc Apple LLVM version 8.1.0 (clang-802.0.38)

All the prerequisites seem to have installed ok, but I always get this error. Also tried the qtwebkit patch to no avail.

[ 42%] Building CXX object src/HdrHTML/CMakeFiles/hdrhtml-cli.dir/hdrhtml.cpp.o
/Users/tune/lhdr/LuminanceHDR/src/HdrHTML/hdrhtml.cpp:659:19: error: use of undeclared identifier 'QCoreApplication'; did you
      mean 'QApplication'?
  lut_filename << HDRHTMLDIR "/hdrhtml_t_b" << basis_no+1 << ".csv";
                  ^
/Users/tune/lhdr/build/src/HdrHTML/hdrhtml-path.hxx:23:20: note: expanded from macro 'HDRHTMLDIR'
#define HDRHTMLDIR QCoreApplication::applicationDirPath()+"/../Resources/hdrhtml"
                   ^
/opt/local/libexec/qt5/lib/QtGui.framework/Headers/qwindowdefs.h:81:7: note: 'QApplication' declared here
class QApplication;
      ^
/Users/tune/lhdr/LuminanceHDR/src/HdrHTML/hdrhtml.cpp:659:19: error: incomplete type 'QApplication' named in nested name
      specifier
  lut_filename << HDRHTMLDIR "/hdrhtml_t_b" << basis_no+1 << ".csv";
                  ^~~~~~~~~~
/Users/tune/lhdr/build/src/HdrHTML/hdrhtml-path.hxx:23:20: note: expanded from macro 'HDRHTMLDIR'
#define HDRHTMLDIR QCoreApplication::applicationDirPath()+"/../Resources/hdrhtml"
                   ^~~~~~~~~~~~~~~~~~
/opt/local/libexec/qt5/lib/QtGui.framework/Headers/qwindowdefs.h:81:7: note: forward declaration of 'QApplication'
class QApplication;
      ^
/Users/tune/lhdr/LuminanceHDR/src/HdrHTML/hdrhtml.cpp:866:19: error: use of undeclared identifier 'QCoreApplication'; did you
      mean 'QApplication'?
  lut_filename << HDRHTMLDIR "/hdrhtml_c_b" << image_list.front().basis+1 << ".csv";
                  ^
/Users/tune/lhdr/build/src/HdrHTML/hdrhtml-path.hxx:23:20: note: expanded from macro 'HDRHTMLDIR'
#define HDRHTMLDIR QCoreApplication::applicationDirPath()+"/../Resources/hdrhtml"
                   ^
/opt/local/libexec/qt5/lib/QtGui.framework/Headers/qwindowdefs.h:81:7: note: 'QApplication' declared here
class QApplication;
      ^
/Users/tune/lhdr/LuminanceHDR/src/HdrHTML/hdrhtml.cpp:866:19: error: incomplete type 'QApplication' named in nested name
      specifier
  lut_filename << HDRHTMLDIR "/hdrhtml_c_b" << image_list.front().basis+1 << ".csv";
                  ^~~~~~~~~~
/Users/tune/lhdr/build/src/HdrHTML/hdrhtml-path.hxx:23:20: note: expanded from macro 'HDRHTMLDIR'
#define HDRHTMLDIR QCoreApplication::applicationDirPath()+"/../Resources/hdrhtml"
                   ^~~~~~~~~~~~~~~~~~
/opt/local/libexec/qt5/lib/QtGui.framework/Headers/qwindowdefs.h:81:7: note: forward declaration of 'QApplication'
class QApplication;
      ^
4 errors generated.
make[2]: *** [src/HdrHTML/CMakeFiles/hdrhtml-cli.dir/build.make:63: src/HdrHTML/CMakeFiles/hdrhtml-cli.dir/hdrhtml.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2248: src/HdrHTML/CMakeFiles/hdrhtml-cli.dir/all] Error 2
make: *** [Makefile:128: all] Error 2

@HIRAM

  1. Which version of Qt5 are you using?
  2. Try editing cmake/Internationalization.cmake and changing QCoreApplication to QApplication either just for HDRHTMLDIR or for all three lines in that IF(APPLE) part.

Ping @fcomida

  1. Have qt5.7.1

That seemed to have fixed part of the issue, perhaps? Still getting this error…

[ 34%] Building CXX object src/HdrHTML/CMakeFiles/hdrhtml-cli.dir/hdrhtml.cpp.o
/Users/tune/lhdr/LuminanceHDR/src/HdrHTML/hdrhtml.cpp:659:19: error: incomplete type 'QApplication' named in nested name specifier
  lut_filename << HDRHTMLDIR "/hdrhtml_t_b" << basis_no+1 << ".csv";
                  ^~~~~~~~~~
/Users/tune/lhdr/build/src/HdrHTML/hdrhtml-path.hxx:23:20: note: expanded from macro 'HDRHTMLDIR'
#define HDRHTMLDIR QApplication::applicationDirPath()+"/../Resources/hdrhtml"
                   ^~~~~~~~~~~~~~
/opt/local/libexec/qt5/lib/QtGui.framework/Headers/qwindowdefs.h:81:7: note: forward declaration of 'QApplication'
class QApplication;
      ^
/Users/tune/lhdr/LuminanceHDR/src/HdrHTML/hdrhtml.cpp:866:19: error: incomplete type 'QApplication' named in nested name specifier
  lut_filename << HDRHTMLDIR "/hdrhtml_c_b" << image_list.front().basis+1 << ".csv";
                  ^~~~~~~~~~
/Users/tune/lhdr/build/src/HdrHTML/hdrhtml-path.hxx:23:20: note: expanded from macro 'HDRHTMLDIR'
#define HDRHTMLDIR QApplication::applicationDirPath()+"/../Resources/hdrhtml"
                   ^~~~~~~~~~~~~~
/opt/local/libexec/qt5/lib/QtGui.framework/Headers/qwindowdefs.h:81:7: note: forward declaration of 'QApplication'
class QApplication;
      ^
2 errors generated.
make[2]: *** [src/HdrHTML/CMakeFiles/hdrhtml-cli.dir/build.make:63: src/HdrHTML/CMakeFiles/hdrhtml-cli.dir/hdrhtml.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2248: src/HdrHTML/CMakeFiles/hdrhtml-cli.dir/all] Error 2
make: *** [Makefile:128: all] Error 2

Hello, the Windows build is with Qt 5.8, on Linux it has been built with Qt from 5.5 to 5.8.
It builds on Windows which has a similar code for HDRHTML. Can you try adding #include to hdrhtml.cpp.

By the way, Davide has no time for LHDR anymore, sadly. We are looking for a maintainer for OSX, what’s your experience Hiram?

Thank you Franco.
I tried adding a line #include into hdrhtml.cpp but get an additional error as I haven’t specified a filename along with the previous errors.
As far as Mac package maintaining I’ve got no experience… Scored an A+ in ANSI C and abstract data structures back in my college days, I’ve done some basic with excel in thermodynamics, other sciency stuff.
If I can get a working app, I’d be happy to share it.

Maybe worth to get in contact with @partha and @ion12? They make the OSX builds for RawTherapee.

Just finished downgrading to qt56-* but same errors.
Also tried qt55, same errors.

Qt5.7 should be fine. What’s the error after adding #include <QApplication>?

Open hdrhtml.cpp and change line 42: #ifdef WIN32 with #if defined (WIN32) || defined (__APPLE__)
This should work. Let me know.

What’s the error after adding #include ?

Error:

[  0%] Building CXX object src/HdrHTML/CMakeFiles/hdrhtml-cli.dir/hdrhtml.cpp.o
/Users/tune/lhdr/LuminanceHDR/src/HdrHTML/hdrhtml.cpp:29:10: fatal error: 'QApplication' file not found
#include <QApplication>
         ^
1 error generated.
make[2]: *** [src/HdrHTML/CMakeFiles/hdrhtml-cli.dir/build.make:63: src/HdrHTML/CMakeFiles/hdrhtml-cli.dir/hdrhtml.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2248: src/HdrHTML/CMakeFiles/hdrhtml-cli.dir/all] Error 2
make: *** [Makefile:128: all] Error 2

This also generates these errors:

[  0%] Building CXX object src/HdrHTML/CMakeFiles/hdrhtml-cli.dir/hdrhtml.cpp.o
/Users/tune/lhdr/LuminanceHDR/src/HdrHTML/hdrhtml.cpp:659:19: error: incomplete type 'QApplication' named in nested name specifier
  lut_filename << HDRHTMLDIR "/hdrhtml_t_b" << basis_no+1 << ".csv";
                  ^~~~~~~~~~
/Users/tune/lhdr/build/src/HdrHTML/hdrhtml-path.hxx:23:20: note: expanded from macro 'HDRHTMLDIR'
#define HDRHTMLDIR QApplication::applicationDirPath()+"/../Resources/hdrhtml"
                   ^~~~~~~~~~~~~~
/opt/local/libexec/qt5/lib/QtCore.framework/Headers/qobject.h:453:18: note: forward declaration of 'QApplication'
    friend class QApplication;
                 ^
/Users/tune/lhdr/LuminanceHDR/src/HdrHTML/hdrhtml.cpp:866:19: error: incomplete type 'QApplication' named in nested name specifier
  lut_filename << HDRHTMLDIR "/hdrhtml_c_b" << image_list.front().basis+1 << ".csv";
                  ^~~~~~~~~~
/Users/tune/lhdr/build/src/HdrHTML/hdrhtml-path.hxx:23:20: note: expanded from macro 'HDRHTMLDIR'
#define HDRHTMLDIR QApplication::applicationDirPath()+"/../Resources/hdrhtml"
                   ^~~~~~~~~~~~~~
/opt/local/libexec/qt5/lib/QtCore.framework/Headers/qobject.h:453:18: note: forward declaration of 'QApplication'
    friend class QApplication;
                 ^
2 errors generated.
make[2]: *** [src/HdrHTML/CMakeFiles/hdrhtml-cli.dir/build.make:63: src/HdrHTML/CMakeFiles/hdrhtml-cli.dir/hdrhtml.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2248: src/HdrHTML/CMakeFiles/hdrhtml-cli.dir/all] Error 2
make: *** [Makefile:128: all] Error 2

Allright, I guess I got the fix, there were other changes to make as well. I just pushed it, pull latest commits and start with a clean build once again.

Breezed thru previously offending code but threw this at me:

Scanning dependencies of target luminance-hdr-cli
[ 50%] Linking CXX executable luminance-hdr-cli
Undefined symbols for architecture x86_64:
  "std::runtime_error::what() const", referenced from:
      vtable for boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::bad_function_call> > in libmain_cli.a(commandline.cpp.o)
      vtable for boost::exception_detail::error_info_injector<boost::bad_function_call> in libmain_cli.a(commandline.cpp.o)
      vtable for boost::bad_function_call in libmain_cli.a(commandline.cpp.o)
      vtable for pfs::Exception in libhdrhtml-cli.a(pfsouthdrhtml.cpp.o)
      boost::system::system_error::what() const in libpfs.a(TonemapOperator.cpp.o)
      vtable for pfs::Exception in libpfs.a(colorspace.cpp.o)
      vtable for pfs::io::WriteException in libpfs.a(tiffwriter.cpp.o)
      ...
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::find(char, unsigned long) const", referenced from:
      hdrhtml::create_from_template(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, hdrhtml::ReplacePattern*) in libhdrhtml-cli.a(hdrhtml.cpp.o)
      hdrhtml::CSVTable::read(char const*, int) in libhdrhtml-cli.a(hdrhtml.cpp.o)
      boost::basic_format<char, std::__1::char_traits<char>, std::__1::allocator<char> >::parse(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libviewers.a(PanIconWidget.cpp.o)
      int boost::io::detail::upper_bound_from_fstring<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::ctype<char> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::value_type, std::__1::ctype<char> const&, unsigned char) in libviewers.a(PanIconWidget.cpp.o)
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::rfind(char, unsigned long) const", referenced from:
      generate_hdrhtml(pfs::Frame*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int, bool) in libhdrhtml-cli.a(pfsouthdrhtml.cpp.o)

etc etc etc for 50 more pages.

Did you start from a clean buildroot?

Yes that was from a fresh clone.

@HIRAM not just fresh clone but also fresh build dir?

Yes, start again from a fresh build directory. How was boost compiled/installed? Googleing around I found you may need -stdlib=libc++ flag and maybe an additional -lc++abi linker flag, I’m not sure. This is currently disabled on cmake/CompilerSettings.cmake under “clang” section. I’ve been able to compile LHDR with clang here in Linux but clang on Linux uses libstdc++ (like everything else).

Yes an empty build dir was always used.

Boost came in thru Mac ports.