rncbc / qtractor

Qtractor - An Audio/MIDI multi-track sequencer
https://qtractor.org
GNU General Public License v2.0
509 stars 88 forks source link

0.9.20: Include for QWindow missing #297

Closed dvzrv closed 3 years ago

dvzrv commented 3 years ago

Hey! When compiling 0.9.20 using cmake, I ran into the following:

[ 52%] Building CXX object src/CMakeFiles/qtractor.dir/qtractorMidiEngine.cpp.o
cd /build/qtractor/src/qtractor-0.9.20/build/src && /usr/bin/c++ -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_XML_LIB -I/build/qtractor/src/qtractor-0.9.20/build/src -I/build/qtractor/src/qtractor-0.9.20/src -I/build/qtractor/src/qtractor-0.9.20/build/src/qtractor_autogen/include -I/build/qt
ractor/src/qtractor-0.9.20/src/vestige -I/build/qtractor/src/qtractor-0.9.20/src/lv2 -I/usr/include/vst3sdk -isystem /usr/include/opus -isystem /usr/include/lilv-0 -isystem /usr/include/serd-0 -isystem /usr/include/sord-0 -isystem /usr/include/sratom-0 -isystem /usr/include/suil-0 -isystem /usr/include/qt -isystem /us
r/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtCore -isystem /usr/lib/qt/mkspecs/linux-g++ -isystem /usr/include/qt/QtXml -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -msse -mfpmath=sse -ffast-math -fPIC -std=gnu++17 -o CMakeFiles/qtractor.dir/qtractorMidiEngine
.cpp.o -c /build/qtractor/src/qtractor-0.9.20/src/qtractorMidiEngine.cpp
/build/qtractor/src/qtractor-0.9.20/src/qtractorLv2Plugin.cpp: In member function ‘void qtractorLv2Plugin::lv2_ui_resize(const QSize&)’:
/build/qtractor/src/qtractor-0.9.20/src/qtractorLv2Plugin.cpp:4178:31: error: incomplete type ‘QWindow’ used in nested name specifier
 4178 |   QWindow *pWindow = QWindow::fromWinId(wid);
      |                               ^~~~~~~~~
/build/qtractor/src/qtractor-0.9.20/src/qtractorLv2Plugin.cpp:4180:11: error: invalid use of incomplete type ‘class QWindow’
 4180 |    pWindow->resize(size);
      |           ^~
In file included from /usr/include/qt/QtGui/qpaintdevice.h:44,
                 from /usr/include/qt/QtGui/qpixmap.h:44,
                 from /usr/include/qt/QtGui/qicon.h:46,
                 from /usr/include/qt/QtGui/QIcon:1,
                 from /build/qtractor/src/qtractor-0.9.20/build/src/qtractor_autogen/include/ui_qtractorMainForm.h:35,
                 from /build/qtractor/src/qtractor-0.9.20/src/qtractorMainForm.h:25,
                 from /build/qtractor/src/qtractor-0.9.20/src/qtractorLv2Plugin.cpp:41:
/usr/include/qt/QtGui/qwindowdefs.h:54:7: note: forward declaration of ‘class QWindow’
   54 | class QWindow;
      |       ^~~~~~~
/build/qtractor/src/qtractor-0.9.20/src/qtractorLv2Plugin.cpp:4181:4: warning: possible problem detected in invocation of ‘operator delete’ [-Wdelete-incomplete]
 4181 |    delete pWindow;
      |    ^~~~~~~~~~~~~~
/build/qtractor/src/qtractor-0.9.20/src/qtractorLv2Plugin.cpp:4178:12: warning: ‘pWindow’ has incomplete type
 4178 |   QWindow *pWindow = QWindow::fromWinId(wid);
      |            ^~~~~~~
In file included from /usr/include/qt/QtGui/qpaintdevice.h:44,
                 from /usr/include/qt/QtGui/qpixmap.h:44,
                 from /usr/include/qt/QtGui/qicon.h:46,
                 from /usr/include/qt/QtGui/QIcon:1,
                 from /build/qtractor/src/qtractor-0.9.20/build/src/qtractor_autogen/include/ui_qtractorMainForm.h:35,
                 from /build/qtractor/src/qtractor-0.9.20/src/qtractorMainForm.h:25,
                 from /build/qtractor/src/qtractor-0.9.20/src/qtractorLv2Plugin.cpp:41:
/usr/include/qt/QtGui/qwindowdefs.h:54:7: note: forward declaration of ‘class QWindow’
   54 | class QWindow;
      |       ^~~~~~~
/build/qtractor/src/qtractor-0.9.20/src/qtractorLv2Plugin.cpp:4181:4: note: neither the destructor nor the class-specific ‘operator delete’ will be called, even if they are declared when the class is defined
 4181 |    delete pWindow;
      |    ^~~~~~~~~~~~~~

It appears that the include for QWindow is tied to the ifdef for CONFIG_LV2_UI_GTK2 in src/qtractorLv2Plugin.h, which seems not to be set (anymore?).

dvzrv commented 3 years ago

I fixed it like so, but I'm not sure if that's how you would expect to fix it:

diff -ruN a/src/qtractorLv2Plugin.h b/src/qtractorLv2Plugin.h
--- a/src/qtractorLv2Plugin.h   2021-02-12 08:35:41.220805288 +0100
+++ b/src/qtractorLv2Plugin.h   2021-02-12 22:06:40.296752753 +0100
@@ -65,9 +65,7 @@
 #include "lv2_external_ui.h"
 #endif
 #if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
-#ifdef CONFIG_LV2_UI_GTK2
 #include <QWindow>
-#endif // CONFIG_LV2_UI_GTK2
 #endif
 // LV2 UI Request-value support (FAKE).
 #ifdef  CONFIG_LV2_UI_REQ_VALUE_FAKE

If that's okay, I can create a pull request for this

rncbc commented 3 years ago

fixed by f6f6742e in develop branch

it would get over it if you add gtk2 (makedepends?) at build time ;) which is recommended anyway :)

dvzrv commented 3 years ago

Thanks! All is well in 0.9.21 now! :)