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

Qt Platform Abstraction header files is missing #1226

Closed
xq114 opened this issue Feb 2, 2021 · 7 comments
Closed

Qt Platform Abstraction header files is missing #1226

xq114 opened this issue Feb 2, 2021 · 7 comments
Milestone

Comments

@xq114
Copy link
Contributor

xq114 commented Feb 2, 2021

注:提问题时若使用不能用/没效果/有问题/报错此类模糊表达,但又没有根据下面的模板给出任何相关辅助信息的,将会直接标记为Invalid。

描述问题

https://doc.qt.io/qt-6/qpa.html

qpa文件夹位于<qt-sdk>/include/QtGui/<version>/QtGui/qpa,其中的头文件引用为#include <qpa/qplatformwindow.h>等形式,目前xmake无法编译含qpa的程序

compiling.release src\widget.cpp
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX64\\x64\\cl.exe" -c /EHsc -nologo -Ox 
-fp:fast -std:c++17 -IC:\Users\xq114\Projects\test\build\.gens\test\windows\x64\release\rules\qt\ui -IC:\Users\xq114\_usr\local\Qt\6.0.0\msvc2019_64\include\QtGui -IC:\Users\xq114\_usr\local\Qt\6.0.0\msvc2019_64\include\QtWidgets -IC:\Users\xq114\_usr\local\Qt\6.0.0\msvc2019_64\include\QtCore -IC:\Users\xq114\_usr\local\Qt\6.0.0\msvc2019_64\include -IC:\Users\xq114\_usr\local\Qt\6.0.0\msvc2019_64\mkspecs\win32-msvc -DQT_NO_DEBUG -DQT_DEPRECATED_WARNINGS -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_CORE_LIB -D_WINDOWS -DNDEBUG -Fobuild\.objs\InnoReader\windows\x64\release\src\widget.cpp.obj src\widget.cpp
error: widget.cpp
C:\Users\xq114\_usr\local\Qt\6.0.0\msvc2019_64\include\QtGui/6.0.0/QtGui/qpa/qplatformwindow.h(58): fatal error C1083: Cannot open include file: 'qpa/qplatformopenglcontext.h': No such file or directory

期待的结果

添加头文件文件夹<qt-sdk>/include/QtGui/<version>/QtGui

错误信息

如上

相关环境

请提供编译和运行环境信息,下面是一些必须填写的基础信息,便于我们针对性排查问题:

  • xmake版本:2.5.1
  • xmake运行平台:windows
  • xmake目标平台:windows

其他信息

直接用到的文件为qplatformwindow.h

@waruqi waruqi added this to the v2.5.2 milestone Feb 2, 2021
@waruqi
Copy link
Member

waruqi commented Feb 2, 2021

qt 6 的问题 我回头会统一处理,先暂时放着吧

@xq114
Copy link
Contributor Author

xq114 commented Feb 2, 2021

qt 6 的问题 我回头会统一处理,先暂时放着吧

这个问题在qt5也存在

https://doc.qt.io/qt-5/qpa.html

@waruqi
Copy link
Member

waruqi commented Feb 2, 2021

一样,qt的问题 我回头会在这个版本一起弄,现在还没时间看这个。。

@waruqi
Copy link
Member

waruqi commented Feb 5, 2021

dev上我加上了,再试试

@xq114
Copy link
Contributor Author

xq114 commented Feb 5, 2021

还不行,现在报错

C:\Qt\6.0.0\msvc2019_64\include\QtGui/6.0.0/QtGui/qpa/qplatformwindow_p.h(54): fatal error C1083: Cannot open include file: 'QtGui/private/qtguiglobal_p.h': No such file or directory

以下是我用的临时修复

        target:add("includedirs", qtdir .. "/include/QtCore/6.0.0")
        target:add("includedirs", qtdir .. "/include/QtGui/6.0.0")
        target:add("includedirs", qtdir .. "/include/QtGui/6.0.0/QtGui")

@waruqi
Copy link
Member

waruqi commented Feb 5, 2021

    target:add("includedirs", qtdir .. "/include/QtGui/6.0.0/QtGui")

这个应该已经加了。。

    target:add("includedirs", qtdir .. "/include/QtGui/6.0.0")

这个还没加,我刚加上了,再试试

@xq114
Copy link
Contributor Author

xq114 commented Feb 5, 2021

可以了

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

No branches or pull requests

2 participants