我想尝试使用 QCircularBuffer
,参考自https://doc.qt.io/archives/qt-5.5/qt3d-qcircularbuffer.html。因此,在macOS上使用QtCreator创建了一个简单的Qt(版本为5.15.1)项目,如下所示:
#include <QApplication>
#include <QWidget>
#include <Qt3D>
int main(int argc, char *argv[]) {
QApplication a(argc, argv);
QWidget w;
w.show();
return a.exec();
}
在项目文件中,我有以下内容
QT += core gui widgets 3dcore
但我无法构建这个,我遇到了以下问题:
18:48:09: Running steps for project project...
18:48:09: Configuration unchanged, skipping qmake step.
18:48:09: Starting: "/usr/bin/make" -j8
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=gnu++1z -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.13 -Wall -Wextra -fPIC -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_3DCORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../../Qt5.15.1/5.15.1/clang_64/lib/QtWidgets.framework/Headers -I../../Qt5.15.1/5.15.1/clang_64/lib/Qt3DCore.framework/Headers -I../../Qt5.15.1/5.15.1/clang_64/lib/QtGui.framework/Headers -I../../Qt5.15.1/5.15.1/clang_64/lib/QtNetwork.framework/Headers -I../../Qt5.15.1/5.15.1/clang_64/lib/QtCore.framework/Headers -Idebug -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/AGL.framework/Headers -I../../Qt5.15.1/5.15.1/clang_64/mkspecs/macx-clang -F/Users/user/Qt5.15.1/5.15.1/clang_64/lib -o debug/main.o main.cpp
main.cpp:6:10: fatal error: 'Qt3D' file not found
#include <Qt3D>
^~~~~~
1 error generated.
make: *** [debug/main.o] Error 1
18:48:10: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project project (kit: Desktop Qt 5.15.1 clang 64bit)
The kit Desktop Qt 5.15.1 clang 64bit has configuration issues which might be the root cause for this problem.
When executing step "Make"
看起来我做错了什么,是吗?
#include <Qt3D>
,项目可以使用QT += core gui widgets 3dcore
正常构建。 - KcFnMiQContiguousCache
?它看起来具有相同的功能。顺便说一下,我从来没有见过有人像你这样导入Qt3D。我总是直接导入我需要的类。 - Florian BlumeQCircularBuffer
?假设我正在使用拥有QCircularBuffer
版本的Qt。 - KcFnMi