Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.9.20: Include for QWindow missing #297

Closed
dvzrv opened this issue Feb 12, 2021 · 3 comments
Closed

0.9.20: Include for QWindow missing #297

dvzrv opened this issue Feb 12, 2021 · 3 comments

Comments

@dvzrv
Copy link

dvzrv commented Feb 12, 2021

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
Copy link
Author

dvzrv commented Feb 12, 2021

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
Copy link
Owner

rncbc commented Feb 13, 2021

fixed by f6f6742 in develop branch

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

@dvzrv
Copy link
Author

dvzrv commented Mar 18, 2021

Thanks! All is well in 0.9.21 now! :)

@dvzrv dvzrv closed this as completed Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants