gpt4 book ai didi

c++ - Qt 解决方案 QtPropertyBrowser : member access into incomplete type

转载 作者:行者123 更新时间:2023-11-28 06:08:10 28 4
gpt4 key购买 nike

我正在尝试编译 qtpropertybrowser ,它是 qt-solutions 的一部分.我将它作为 SUBDIRS 的一部分包含在 subdirs 项目中。我在 buildlib/buildlib.pro 上运行了 qmake ,通过 Qt Creator,然后是生成的 Makefile,并收到来自 moc 文件的错误:

/the_path/buildlib/moc_qtpropertybrowser.cpp:360: error: member access into incomplete type 'QtAbstractPropertyBrowserPrivate'
case 4: _t->d_func()->slotPropertyInserted((*reinterpret_cast< QtProperty*(*)>(_a[1])),(*reinterpret_cast< QtProperty*(*)>(_a[2])),(*reinterpret_cast< QtProperty*(*)>(_a[3]))); break;
^

完整日志如下:

20:25:29: Running steps for project BALLS...
20:25:29: Starting: "/usr/lib/x86_64-linux-gnu/qt5/bin/qmake" /home/jesse/Code/BALLS/BALLS/qtpropertybrowser.pro -r -spec linux-clang CONFIG+=debug DEFINES+=QTILITIES_PROPERTY_BROWSER
Reading /home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/buildlib/buildlib.pro [/home/jesse/Code/BALLS/build/debug/qt-solutions/qtpropertybrowser/buildlib]
20:25:29: The process "/usr/lib/x86_64-linux-gnu/qt5/bin/qmake" exited normally.
20:25:29: Starting: "/usr/bin/make"
cd qt-solutions/qtpropertybrowser/buildlib/ && ( test -e Makefile || /usr/lib/x86_64-linux-gnu/qt5/bin/qmake /home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/buildlib/buildlib.pro -spec linux-clang CONFIG+=debug DEFINES+=QTILITIES_PROPERTY_BROWSER -o Makefile ) && /usr/bin/make -f Makefile
make[1]: Entering directory '/home/jesse/Code/BALLS/build/debug/qt-solutions/qtpropertybrowser/buildlib'
clang++ -c -pipe -g -D_REENTRANT -Wall -W -fPIC -DQTILITIES_PROPERTY_BROWSER -DQT_DISABLE_DEPRECATED_BEFORE=0 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/buildlib -I. -I/home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/src -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-clang -o qtpropertybrowser.o /home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/src/qtpropertybrowser.cpp
clang++ -c -pipe -g -D_REENTRANT -Wall -W -fPIC -DQTILITIES_PROPERTY_BROWSER -DQT_DISABLE_DEPRECATED_BEFORE=0 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/buildlib -I. -I/home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/src -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-clang -o qtpropertymanager.o /home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/src/qtpropertymanager.cpp
clang++ -c -pipe -g -D_REENTRANT -Wall -W -fPIC -DQTILITIES_PROPERTY_BROWSER -DQT_DISABLE_DEPRECATED_BEFORE=0 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/buildlib -I. -I/home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/src -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-clang -o qteditorfactory.o /home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/src/qteditorfactory.cpp
clang++ -c -pipe -g -D_REENTRANT -Wall -W -fPIC -DQTILITIES_PROPERTY_BROWSER -DQT_DISABLE_DEPRECATED_BEFORE=0 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/buildlib -I. -I/home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/src -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-clang -o qtvariantproperty.o /home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/src/qtvariantproperty.cpp
/home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/src/qtvariantproperty.cpp:149:24: warning: private field 'q_ptr' is not used [-Wunused-private-field]
QtVariantProperty *q_ptr;
^
1 warning generated.
clang++ -c -pipe -g -D_REENTRANT -Wall -W -fPIC -DQTILITIES_PROPERTY_BROWSER -DQT_DISABLE_DEPRECATED_BEFORE=0 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/buildlib -I. -I/home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/src -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-clang -o qttreepropertybrowser.o /home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/src/qttreepropertybrowser.cpp
clang++ -c -pipe -g -D_REENTRANT -Wall -W -fPIC -DQTILITIES_PROPERTY_BROWSER -DQT_DISABLE_DEPRECATED_BEFORE=0 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/buildlib -I. -I/home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/src -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-clang -o qtbuttonpropertybrowser.o /home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/src/qtbuttonpropertybrowser.cpp
clang++ -c -pipe -g -D_REENTRANT -Wall -W -fPIC -DQTILITIES_PROPERTY_BROWSER -DQT_DISABLE_DEPRECATED_BEFORE=0 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/buildlib -I. -I/home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/src -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-clang -o qtgroupboxpropertybrowser.o /home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/src/qtgroupboxpropertybrowser.cpp
clang++ -c -pipe -g -D_REENTRANT -Wall -W -fPIC -DQTILITIES_PROPERTY_BROWSER -DQT_DISABLE_DEPRECATED_BEFORE=0 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/buildlib -I. -I/home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/src -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-clang -o qtpropertybrowserutils.o /home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/src/qtpropertybrowserutils.cpp
/usr/lib/x86_64-linux-gnu/qt5/bin/rcc -name qtpropertybrowser /home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/src/qtpropertybrowser.qrc -o qrc_qtpropertybrowser.cpp
clang++ -c -pipe -g -D_REENTRANT -Wall -W -fPIC -DQTILITIES_PROPERTY_BROWSER -DQT_DISABLE_DEPRECATED_BEFORE=0 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/buildlib -I. -I/home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/src -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-clang -o qrc_qtpropertybrowser.o qrc_qtpropertybrowser.cpp
/usr/lib/x86_64-linux-gnu/qt5/bin/moc -DQTILITIES_PROPERTY_BROWSER -DQT_DISABLE_DEPRECATED_BEFORE=0 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-clang -I/home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/buildlib -I/home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/src -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/include/c++/4.9 -I/usr/include/x86_64-linux-gnu/c++/4.9 -I/usr/include/c++/4.9/backward -I/usr/lib/gcc/x86_64-linux-gnu/4.9/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/4.9/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include /home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/src/qtpropertybrowser.h -o moc_qtpropertybrowser.cpp
clang++ -c -pipe -g -D_REENTRANT -Wall -W -fPIC -DQTILITIES_PROPERTY_BROWSER -DQT_DISABLE_DEPRECATED_BEFORE=0 -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/buildlib -I. -I/home/jesse/Code/BALLS/BALLS/qt-solutions/qtpropertybrowser/src -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-clang -o moc_qtpropertybrowser.o moc_qtpropertybrowser.cpp
moc_qtpropertybrowser.cpp:360:29: error: member access into incomplete type 'QtAbstractPropertyBrowserPrivate'
case 4: _t->d_func()->slotPropertyInserted((*reinterpret_cast< QtProperty*(*)>(_a[1])),(*reinterpret_cast< QtProperty*(*)>(_a[2])),(*reinterpret_cast< QtProperty*(*)>(_a[3]))); break;
^
./../../../../../BALLS/qt-solutions/qtpropertybrowser/src/qtpropertybrowser.h:263:18: note: forward declaration of 'QtAbstractPropertyBrowserPrivate'
friend class QtAbstractPropertyBrowserPrivate;
^
moc_qtpropertybrowser.cpp:361:29: error: member access into incomplete type 'QtAbstractPropertyBrowserPrivate'
case 5: _t->d_func()->slotPropertyRemoved((*reinterpret_cast< QtProperty*(*)>(_a[1])),(*reinterpret_cast< QtProperty*(*)>(_a[2]))); break;
^
./../../../../../BALLS/qt-solutions/qtpropertybrowser/src/qtpropertybrowser.h:263:18: note: forward declaration of 'QtAbstractPropertyBrowserPrivate'
friend class QtAbstractPropertyBrowserPrivate;
^
moc_qtpropertybrowser.cpp:362:29: error: member access into incomplete type 'QtAbstractPropertyBrowserPrivate'
case 6: _t->d_func()->slotPropertyDestroyed((*reinterpret_cast< QtProperty*(*)>(_a[1]))); break;
^
./../../../../../BALLS/qt-solutions/qtpropertybrowser/src/qtpropertybrowser.h:263:18: note: forward declaration of 'QtAbstractPropertyBrowserPrivate'
friend class QtAbstractPropertyBrowserPrivate;
^
moc_qtpropertybrowser.cpp:363:29: error: member access into incomplete type 'QtAbstractPropertyBrowserPrivate'
case 7: _t->d_func()->slotPropertyDataChanged((*reinterpret_cast< QtProperty*(*)>(_a[1]))); break;
^
./../../../../../BALLS/qt-solutions/qtpropertybrowser/src/qtpropertybrowser.h:263:18: note: forward declaration of 'QtAbstractPropertyBrowserPrivate'
friend class QtAbstractPropertyBrowserPrivate;
^
4 errors generated.
Makefile:692: recipe for target 'moc_qtpropertybrowser.o' failed
make[1]: Leaving directory '/home/jesse/Code/BALLS/build/debug/qt-solutions/qtpropertybrowser/buildlib'
Makefile:42: recipe for target 'sub-qt-solutions-qtpropertybrowser-buildlib-make_first' failed
make[1]: *** [moc_qtpropertybrowser.o] Error 1
make: *** [sub-qt-solutions-qtpropertybrowser-buildlib-make_first] Error 2
20:25:48: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project BALLS (kit: Desktop)
When executing step 'Make'
20:25:48: Elapsed time: 00:19.

qmake 调用是:

qmake /home/jesse/Code/BALLS/BALLS/BALLS.pro -r -spec linux-clang CONFIG+=debug DEFINES+=QTILITIES_PROPERTY_BROWSER

而且这是我什至没有写的代码! 我该如何解决这个问题,以便我可以编译 qtpropertybrowser 并使用它?

最佳答案

这不是您应该构建它的方式。

  1. 创建构建文件夹并进入:

    mkdir ~/qtpropertybrowser-build
    cd ~/qtpropertybrowser-build
  2. 在构建文件夹中,为解决方案运行configure。例如,假设您的 git checkout 在 ~/qt-solutions 中:

    ~/qt-solutions/qtpropertybrowser/configure
  3. 最后,构建它:

    qmake && make -j

关于c++ - Qt 解决方案 QtPropertyBrowser : member access into incomplete type,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31930426/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com