endless-sky / endless-sky-editor

Map editor for the Endless Sky universe.
GNU General Public License v3.0
68 stars 44 forks source link

Invalid use of incomplete type 'class QUrl' #16

Closed kaiser-dg closed 6 years ago

kaiser-dg commented 6 years ago

Sorry to bug you again but I've run into a new error.

MainWindow.cpp: In member function ‘virtual void MainWindow::dropEvent(QDropEvent*)’:
MainWindow.cpp:146:51: error: invalid use of incomplete type ‘const class QUrl’
     QString path = event->mimeData()->urls().at(0).path();
                                                   ^
In file included from /usr/include/qt4/QtGui/qvector2d.h:46:0,
                 from /usr/include/qt4/QtGui/QVector2D:1,
                 from GalaxyView.h:18,
                 from MainWindow.cpp:16:
/usr/include/qt4/QtCore/qmetatype.h:299:7: note: forward declaration of ‘class QUrl’
 class QUrl;
       ^
In file included from /usr/include/qt4/QtCore/qnamespace.h:45:0,
                 from /usr/include/qt4/QtCore/qobjectdefs.h:45,
                 from /usr/include/qt4/QtGui/qwindowdefs.h:45,
                 from /usr/include/qt4/QtGui/qwidget.h:46,
                 from /usr/include/qt4/QtGui/qmainwindow.h:45,
                 from /usr/include/qt4/QtGui/QMainWindow:1,
                 from MainWindow.h:16,
                 from MainWindow.cpp:13:
/usr/include/qt4/QtCore/qglobal.h: In instantiation of ‘class QTypeInfo<QUrl>’:
/usr/include/qt4/QtCore/qlist.h:113:62:   required from ‘T& QList<T>::Node::t() [with T = QUrl]’
/usr/include/qt4/QtCore/qlist.h:470:46:   required from ‘const T& QList<T>::at(int) const [with T = QUrl]’
MainWindow.cpp:146:50:   required from here
/usr/include/qt4/QtCore/qglobal.h:2242:26: error: invalid application of ‘sizeof’ to incomplete type ‘QUrl’
         isLarge = (sizeof(T)>sizeof(void*)),
                          ^
In file included from /usr/include/qt4/QtCore/qobject.h:50:0,
                 from /usr/include/qt4/QtGui/qwidget.h:47,
                 from /usr/include/qt4/QtGui/qmainwindow.h:45,
                 from /usr/include/qt4/QtGui/QMainWindow:1,
                 from MainWindow.h:16,
                 from MainWindow.cpp:13:
/usr/include/qt4/QtCore/qlist.h: In instantiation of ‘void QList<T>::node_destruct(QList<T>::Node*, QList<T>::Node*) [with T = QUrl]’:
/usr/include/qt4/QtCore/qlist.h:757:18:   required from ‘void QList<T>::free(QListData::Data*) [with T = QUrl ’
/usr/include/qt4/QtCore/qlist.h:732:13:   required from ‘QList<T>::~QList() [with T = QUrl]’
MainWindow.cpp:138:38:   required from here
/usr/include/qt4/QtCore/qlist.h:431:31: warning: possible problem detected in invocation of delete operator: [-Wdelete-incomplete]
         while(from != to) --to, delete reinterpret_cast<T*>(to->v);
                               ^
/usr/include/qt4/QtCore/qlist.h:431:31: warning: invalid use of incomplete type ‘class QUrl’
In file included from /usr/include/qt4/QtGui/qvector2d.h:46:0,
                 from /usr/include/qt4/QtGui/QVector2D:1,
                 from GalaxyView.h:18,
                 from MainWindow.cpp:16:
/usr/include/qt4/QtCore/qmetatype.h:299:7: note: forward declaration of ‘class QUrl’
 class QUrl;
       ^
In file included from /usr/include/qt4/QtCore/qobject.h:50:0,
                 from /usr/include/qt4/QtGui/qwidget.h:47,
                 from /usr/include/qt4/QtGui/qmainwindow.h:45,
                 from /usr/include/qt4/QtGui/QMainWindow:1,
                 from MainWindow.h:16,
                 from MainWindow.cpp:13:
/usr/include/qt4/QtCore/qlist.h:431:31: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined
         while(from != to) --to, delete reinterpret_cast<T*>(to->v);
                               ^
/usr/include/qt4/QtCore/qlist.h:433:32: error: invalid use of incomplete type ‘class QUrl’
         while (from != to) --to, reinterpret_cast<T*>(to)->~T();
                                ^
In file included from /usr/include/qt4/QtGui/qvector2d.h:46:0,
                 from /usr/include/qt4/QtGui/QVector2D:1,
                 from GalaxyView.h:18,
                 from MainWindow.cpp:16:
/usr/include/qt4/QtCore/qmetatype.h:299:7: note: forward declaration of ‘class QUrl’
 class QUrl;
       ^
make: *** [Makefile:307: MainWindow.o] Error 1
endless-sky commented 6 years ago

I'm not sure why your compiler is giving you these errors and mine is not, but this should be fixed by df885d7.

kaiser-dg commented 6 years ago

Thank you again