當我嘗試使用 Mingw 編譯 QT 6.4.0 靜態時,我遇到了 fxc 錯誤,花費時間后發現這是一個錯誤,因為它無法找到 fxc.exe 所以我將 fxc 添加到 windows 工具包的路徑(10 ),在添加后修復了該錯誤,但現在我遇到了不同的錯誤。
配置: configure.bat -release -static -static-runtime -no-pch -optimize-size -opengl desktop -platform win32-g -prefix "C:\qt\6.4.0static\qt-static" -skip webengine -nomake tools -nomake tests -nomake examples
我的作業系統: Windows 11 Pro (21H2)。
有關更多日志詳細資訊: Pastebin
qsgd3d12engine.cpp: In member function 'D3D12_CPU_DESCRIPTOR_HANDLE QSGD3D12CPUDescriptorHeapManager::allocate(D3D12_DESCRIPTOR_HEAP_TYPE)':
qsgd3d12engine.cpp:121:41: warning: comparison of integer expressions of different signedness: 'int' and 'long long unsigned int' [-Wsign-compare]
121 | for (int bucket = 0; bucket < _countof(heap.freeMap); bucket)
| ^
qsgd3d12engine.cpp:157:23: warning: comparison of integer expressions of different signedness: 'int' and 'long long unsigned int' [-Wsign-compare]
157 | for (int i = 1; i < _countof(heap.freeMap); i)
| ^
qsgd3d12engine.cpp: In function 'void getHardwareAdapter(IDXGIFactory1*, IDXGIAdapter1**)':
qsgd3d12engine.cpp:224:83: error: expected primary-expression before ')' token
224 | HRESULT hr = D3D12CreateDevice(adapter.Get(), fl, _uuidof(ID3D12Device), nullptr);
| ^
qsgd3d12engine.cpp:224:63: error: '_uuidof' was not declared in this scope
224 | HRESULT hr = D3D12CreateDevice(adapter.Get(), fl, _uuidof(ID3D12Device), nullptr);
| ^~~~~~~
In file included from C:/msys64/mingw64/include/winbase.h:2811,
from C:/msys64/mingw64/include/windows.h:70,
from C:/Qt/dev/Qt/src/qtbase/src/corelib/global/qt_windows.h:64,
from C:\Qt\dev\Qt\src\qtbase\include/QtCore/qt_windows.h:1,
from C:/Qt/dev/Qt/src/qtbase/src/gui/opengl/qopengl.h:49,
from C:\Qt\dev\Qt\src\qtbase\include/QtGui/qopengl.h:1,
from C:/Qt/dev/Qt/src/qtdeclarative/src/quick/scenegraph/coreapi/qsggeometry.h:44,
from ..\..\..\..\include\QtQuick/qsggeometry.h:1,
from qsgd3d12engine_p.h:57,
from qsgd3d12engine.cpp:40:
qsgd3d12engine.cpp:241:80: error: expected primary-expression before ')' token
241 | if (SUCCEEDED(D3D12CreateDevice(adapter.Get(), fl, _uuidof(ID3D12Device), nullptr))) {
| ^
qsgd3d12engine.cpp:241:60: error: '_uuidof' was not declared in this scope
241 | if (SUCCEEDED(D3D12CreateDevice(adapter.Get(), fl, _uuidof(ID3D12Device), nullptr))) {
| ^~~~~~~
編輯:修復了問題,查看標記的答案以獲取更多詳細資訊。
uj5u.com熱心網友回復:
要使用 mingw 修復 __uuidof 錯誤,請按照此鏈接中的步驟操作:
https://forum.qt.io/topic/128587/build-failure-_uuidof-was-not-declared-in-this-scope/7
要修復 QT DirectX 問題,請按照以下步驟操作:
從https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/下載 Windows SDK 。(我下載了適用于 Windows 11(我的作業系統)的 SDK)。
在您的首選編輯器中打開此檔案 pathToQTSource\qtdeclarative\plugins\scenegraph\d3d12\qsgd3d12engine.cpp 并將此行添加
#include <d3d12sdklayers.h>到包含部分并保存。而已。
要修復我在編譯 mfvideorenderercontrol.cpp 時遇到的另一個錯誤:
- 轉到 pathToQtSource\qtmultimedia\src\plugins\wmf\player\mfvideorendercontrol.cpp 并將訪問修飾符從protected更改為public of
void customEvent(QEvent *event)function(宣告于class PresentEvent)。
感謝@thedemons幫助我解決了這個問題。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/520139.html
標籤:C qt明威
上一篇:從QComboBox項中洗掉邊框
下一篇:如何嵌入youtube視頻?
