Error when compiling LyX under macOS
pdv
pdvisschere at edpnet.be
Sat Oct 16 12:50:54 UTC 2021
On 12/10/2021 21:36, Enrico Forestieri wrote:
> On Tue, Oct 12, 2021 at 01:15:52PM +0200, Christoph Schmitz wrote:
>
>> macOS Monterey Version 12.0 Beta (21A5543b) and Qt 6.2.0
>>
>> The problem, which first appeared about two weeks ago, still exists. I compile LyX once a day to see if it is fixed, but it is not. I still can't compile LyX under macOS anymore. I have the same issue on two computers (one with Intel processor, the other with M1 processor).
>>
>> The compiler does not find QSvgWidget, although the class is not deprecated in Qt6: https://doc.qt.io/qt-6/qsvgwidget.html <https://doc.qt.io/qt-6/qsvgwidget.html>. I have reinstalled Qt and pulled a new LyX repository several times, but that does not solve the problem.
>>
>> The file qsvgwidget.h is present. It can be found on the Intel Mac in the directory /usr/local/Cellar/qt/6.2.0/lib/QtSvgWidgets.framework/Versions/A/Headers. But even setting a path to this directory does not solve the problem. Does anybody understand what has happened?
>>
>> Since attachments are deleted, I copy the last lines of the output below.
>>
>> --
>> /Applications/Xcode-beta.app/Contents/Developer/usr/bin/make all-recursive
>> Making all in support
>> /Applications/Xcode-beta.app/Contents/Developer/usr/bin/make all-am
>> make[5]: Nothing to be done for `all-am'.
>> Making all in frontends
>> Making all in qt
>> /Applications/Xcode-beta.app/Contents/Developer/usr/bin/make all-am
>> CXX Dialog.o
>> In file included from Dialog.cpp:15:
>> ./GuiView.h:24:10: fatal error: 'QSvgWidget' file not found
>> #include <QSvgWidget>
>> ^~~~~~~~~~~~
>> 1 error generated.
>> make[6]: *** [Dialog.o] Error 1
>> make[5]: *** [all] Error 2
>> make[4]: *** [all-recursive] Error 1
>> make[3]: *** [all-recursive] Error 1
>> make[2]: *** [all] Error 2
>> make[1]: *** [all-recursive] Error 1
>> make: *** [all] Error 2
>
> Please, try again after 47f1fec9
>
A similar modification is needed when building with CMake on MacOS.
I've included module SvgWidgets with qt6 and MacExtras with previous
versions (I have checked builds on MacOS with qt6 and qt5, but not with
qt4). (patch included)
I have also not touched the windows code which will probably show the
same problem.
Patrick
-------------- next part --------------
diff --git a/src/frontends/qt/CMakeLists.txt b/src/frontends/qt/CMakeLists.txt
index 282db37ff7..cd07f84f27 100644
--- a/src/frontends/qt/CMakeLists.txt
+++ b/src/frontends/qt/CMakeLists.txt
@@ -43,8 +43,12 @@ else()
endif()
set_target_properties(frontend_qt PROPERTIES FOLDER "applications/LyX" QT_NO_UNICODE_DEFINES TRUE)
-if(Qt5Core_FOUND AND APPLE)
- qt_use_modules(frontend_qt Core Gui Widgets Concurrent Svg MacExtras)
+if(${QtVal}Core_FOUND AND APPLE)
+ if(Qt6Core_FOUND)
+ qt_use_modules(frontend_qt Core Gui Widgets Concurrent Svg SvgWidgets)
+ else()
+ qt_use_modules(frontend_qt Core Gui Widgets Concurrent Svg MacExtras)
+ endif()
else()
if (Qt5WinExtras_FOUND)
qt_use_modules(frontend_qt Core Gui Widgets Concurrent Svg WinExtras)
More information about the lyx-devel
mailing list