Sigil-Ebook / PageEdit

ePub XHTML Visual Editor
GNU General Public License v3.0
248 stars 28 forks source link

UIDictionary.cpp won't compile for QT5, because of breaking method name change in QT6 QLibraryInfo class. #37

Closed rwperrott closed 7 months ago

rwperrott commented 7 months ago

On Linux Mint 21.3 MATE 64-bit

I can't seem to compile with QT6, so added -DUSE_Qt5=1 to the cmake line, and tried to compile 2.1.0 source:

 cmake "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DUSE_Qt5=1 -DINSTALL_BUNDLED_DICTS=0 ../PageEdit-2.1.0
CMake Warning:
  Ignoring extra path from command line:

   "/home/richard/Downloads/@Software/@Source/pageedit_build/Unix Makefiles"

CMake Deprecation Warning at CMakeLists.txt:10 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at gumbo_subtree/src/CMakeLists.txt:10 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: /home/richard/Downloads/@Software/@Source/pageedit_build
$ make
[ 17%] Built target gumbo
[ 17%] Built target pageedit_autogen_timestamp_deps
[ 18%] Built target pageedit_autogen
[ 19%] Building CXX object CMakeFiles/pageedit.dir/UIDictionary.cpp.o
/home/richard/Downloads/@Software/@Source/PageEdit-2.1.0/UIDictionary.cpp: In static member function ‘static QString UIDictionary::GetDictionaryPath()’:
/home/richard/Downloads/@Software/@Source/PageEdit-2.1.0/UIDictionary.cpp:60:31: error: ‘path’ is not a member of ‘QLibraryInfo’
   60 |     dict_path = QLibraryInfo::path(QLibraryInfo::DataPath) + "/qtwebengine_dictionaries";
      |                               ^~~~
make[2]: *** [CMakeFiles/pageedit.dir/build.make:553: CMakeFiles/pageedit.dir/UIDictionary.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:104: CMakeFiles/pageedit.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Which failed for make, because QT5 QLibraryInfo does not have a path method.

But, make worked when I changed line 61 in UIDictionary.cpp to:

    dict_path = QLibraryInfo::location(QLibraryInfo::DataPath) + "/qtwebengine_dictionaries";

, sudo make install works, and pageedit seems to run OK.

.. it probably needs a #ifdef.. #else.. #endif added, to lines with different method names, but I'm not familiar enough with cmake and make to do this, so I'll leave you to do this.

kevinhendricks commented 7 months ago

Thank you for your bug report.

Closing as duplicate of: https://github.com/Sigil-Ebook/PageEdit/issues/35

The fix for this was already merged to master. Just cherry pick it from master.

Our continued 1 year support promise for building Sigil and PageEdit with Qt5 will run out in July. Qt6 is already working quite well and is getting timely security fixes. which is no longer true for Qt5. Please move to Qt6 based builds as soon as feasible.

dougmassay commented 7 months ago

There was only the one commit to PageEdit's codebase following the 2.1.0 release, so going with the current master branch would get the fix and nothing else. The other commits since release are only related to Continued Integration/Automation.

kevinhendricks commented 7 months ago

And if you want help building Sigil /PageEdit with Qt 6 on your Linux box (assuming Qt6 is available in your repos) simply post the build log and error messages in a new post in the Sigil Forum on Mobileread. There are many Linux users there who may be able to help set up the build environment.