Sorry, it was Clipboard.h instead of GuiClipboard.h. Moreover, I found that
ConsoleApplicationPrivate.h does a forward declaration of
ConsoleApplication, but uses one of the methods. This required the full
declaration of the class, we may need to include ConsoleApplication.h in
there.

Also, moc_GuiViewSource.cpp gives an error of "incomplete type" if we don't
include TexRow.h in GuiViewSource.h, and the same thing with GuiDocument.h
and TempFile.h.

I have included everything in the patch. When I look at those errors, the
fix seems like a best practice to me, this is why I'm proposing the
changes. Also, I can't figure how can CMake and Autotools still finish the
build.

My build environment Fedora 41 with qt6 and a Meson build script I've been
working on. So far it's looking good and with the changes in the patch it
compiles everything and it gets to the final linking stage. Then it fails
on "multiple definitions of function" over the cpp files and the moc
generated ones. I still need to figure this one out.

Cheers,
Lorenzo

Il giorno dom 17 nov 2024 alle ore 20:43 Pavel Sanda <sa...@lyx.org> ha
scritto:

> On Sun, Nov 17, 2024 at 12:12:11PM +0100, Lorenzo Bertini wrote:
> > Dear devs,
> > when trying to port LyX to yet another build system I found that
> > src/frontends/GuiClipboard.h is missing <string> and
> "support/docstring.h",
> > and GuiSearch.h only "support/docstring.h". I don't exactly know how
> > autotools manages to build anyway, but the files use std::string and
> > docstring without including, so maybe they should include.
>
> My doing, indeed I was expecting this might break on some different
> setup. What exactly is your "build environment"?
>
> Is this patch enough?
>
> Pavel
> --
> lyx-devel mailing list
> lyx-devel@lists.lyx.org
> https://lists.lyx.org/mailman/listinfo/lyx-devel
>
From 36011bbe70f881c35aeaeb7102aac1ac9bb2c321 Mon Sep 17 00:00:00 2001
From: Lorenzo Bertini <lorenzobertin...@gmail.com>
Date: Mon, 18 Nov 2024 09:54:02 +0100
Subject: [PATCH 1/1] Fix meson build

---
 src/frontends/Clipboard.h               | 2 ++
 src/frontends/qt/GuiDocument.h          | 2 +-
 src/frontends/qt/GuiSearch.h            | 1 +
 src/frontends/qt/GuiViewSource.h        | 1 +
 src/support/ConsoleApplicationPrivate.h | 2 +-
 5 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/frontends/Clipboard.h b/src/frontends/Clipboard.h
index 13066eb279..67fbbb6e86 100644
--- a/src/frontends/Clipboard.h
+++ b/src/frontends/Clipboard.h
@@ -14,6 +14,8 @@
 #ifndef BASE_CLIPBOARD_H
 #define BASE_CLIPBOARD_H
 
+#include "support/docstring.h"
+
 namespace lyx {
 
 class Cursor;
diff --git a/src/frontends/qt/GuiDocument.h b/src/frontends/qt/GuiDocument.h
index 8ff27f5670..48e406ddf3 100644
--- a/src/frontends/qt/GuiDocument.h
+++ b/src/frontends/qt/GuiDocument.h
@@ -16,8 +16,8 @@
 #include "BufferParams.h"
 #include "GuiDialog.h"
 #include "GuiIdListModel.h"
-
 #include "LaTeXHighlighter.h"
+#include "support/TempFile.h"
 
 #include "ui_BiblioUi.h"
 #include "ui_ColorUi.h"
diff --git a/src/frontends/qt/GuiSearch.h b/src/frontends/qt/GuiSearch.h
index 5ff29abb20..d8af829e39 100644
--- a/src/frontends/qt/GuiSearch.h
+++ b/src/frontends/qt/GuiSearch.h
@@ -20,6 +20,7 @@
 #include <QDockWidget>
 
 #include "ui_SearchUi.h"
+#include "support/docstring.h"
 
 namespace lyx {
 namespace frontend {
diff --git a/src/frontends/qt/GuiViewSource.h b/src/frontends/qt/GuiViewSource.h
index f75978d34e..f1d4ca94c6 100644
--- a/src/frontends/qt/GuiViewSource.h
+++ b/src/frontends/qt/GuiViewSource.h
@@ -18,6 +18,7 @@
 
 #include "Buffer.h"
 #include "DockView.h"
+#include "TexRow.h"
 
 #include <QDockWidget>
 #include <QString>
diff --git a/src/support/ConsoleApplicationPrivate.h b/src/support/ConsoleApplicationPrivate.h
index 347f9ad62f..be268b1103 100644
--- a/src/support/ConsoleApplicationPrivate.h
+++ b/src/support/ConsoleApplicationPrivate.h
@@ -21,7 +21,7 @@
 #endif
 
 #include <string>
-
+#include "ConsoleApplication.h"
 
 namespace lyx {
 
-- 
2.47.0

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
https://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to