xmake icon indicating copy to clipboard operation
xmake copied to clipboard

Qt6 vscode插件调试闪退

Open Nowaterisenough opened this issue 2 years ago • 11 comments

Xmake 版本

2.8.1

操作系统版本和架构

Windows 11 22621.1992

描述问题

vscode qt6程序,构建运行都正常,调试闪退,推测是没有链接到正确的debug库

期待的结果

希望调试正常

工程配置

target("test") add_files(".cpp") add_files(".h") add_rules("qt.widgetapp")

附加信息和错误日志

qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "" This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Debug Error!

Program: ...rs\NoWat\Project\JX3DPS2\build\windows\x64\debug\Qt6Cored.dll Module: 6.5.1 File: C:\Users\qt\work\qt\qtbase\src\gui\kernel\qguiapplication.cpp Line: 1257

This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

(Press Retry to debug the application)

Nowaterisenough avatar Jul 21 '23 06:07 Nowaterisenough

Bot detected the issue body's language is not English, translate it automatically.


Title: Qt6 vscode plugin debugging flashback

Issues-translate-bot avatar Jul 21 '23 06:07 Issues-translate-bot

噢,插件库没有加载,话说除了命令行和自定义on_install的方式,有没有内置的语句可以直接调用windeploy打包

Nowaterisenough avatar Jul 21 '23 17:07 Nowaterisenough

Bot detected the issue body's language is not English, translate it automatically.


Oh, the plug-in library is not loaded. In addition to the command line and custom on_install, is there any built-in statement that can directly call windeploy to package

Issues-translate-bot avatar Jul 21 '23 17:07 Issues-translate-bot

这是我目前的做法,感觉很丑,不知道有没有更优雅的实现

rule("qtpackage")
    after_build(function (target)
        import("detect.sdks.find_qt")
        local qt = assert(find_qt(), "Qt SDK not found!")
        local windeployqt = path.join(qt.bindir, "windeployqt.exe")
        assert(os.isexec(windeployqt), "windeployqt.exe not found!")
        local targetpath = target:targetdir() .. "/" .. target:basename() .. ".exe"
        os.run(windeployqt .. " $(projectdir)/" .. targetpath, {envs = envs})
    end)

Nowaterisenough avatar Jul 21 '23 19:07 Nowaterisenough

噢,插件库没有加载,话说除了命令行和自定义on_install的方式,有没有内置的语句可以直接调用windeploy打包

https://github.com/xmake-io/xmake/blob/cb6ac8efc7aecc0bf24d8a1844d0c76233cb84ea/xmake/rules/qt/install/windows.lua#L44

star-hengxing avatar Jul 21 '23 23:07 star-hengxing

噢,插件库没有加载,话说除了命令行和自定义on_install的方式,有没有内置的语句可以直接调用windeploy打包

https://github.com/xmake-io/xmake/blob/cb6ac8efc7aecc0bf24d8a1844d0c76233cb84ea/xmake/rules/qt/install/windows.lua#L44

这个就是我楼上的办法了,我的意思是没有内置的其他办法了

Nowaterisenough avatar Jul 22 '23 00:07 Nowaterisenough

没有内置,由于每次 build 都要 deploy,太慢了,用户有需要就按上面自己搞下。

waruqi avatar Jul 22 '23 13:07 waruqi

Bot detected the issue body's language is not English, translate it automatically.


There is no built-in, because deploy is required for every build, it is too slow, users can do it according to the above if necessary.

Issues-translate-bot avatar Jul 22 '23 14:07 Issues-translate-bot

没有内置,由于每次 build 都要 deploy,太慢了,用户有需要就按上面自己搞下。

当项目名中有空格的时候,会出现被截断导致没办法正常打包的情况

Nowaterisenough avatar Jul 22 '23 21:07 Nowaterisenough

Bot detected the issue body's language is not English, translate it automatically.


There is no built-in, because deploy is required for every build, it is too slow, users can do it by themselves according to the above if necessary.

When there is a space in the project name, it will be truncated and cannot be packaged normally

Issues-translate-bot avatar Jul 22 '23 21:07 Issues-translate-bot

没有内置,由于每次 build 都要 deploy,太慢了,用户有需要就按上面自己搞下。

当项目名中有空格的时候,会出现被截断导致没办法正常打包的情况

你可以调下这里 然后提个 pr 过来

https://github.com/xmake-io/xmake/blob/master/xmake/rules/qt/install/windows.lua

waruqi avatar Jul 23 '23 13:07 waruqi