qt icon indicating copy to clipboard operation
qt copied to clipboard

Compiling for Windows shows a command prompt

Open amlwwalker opened this issue 6 years ago • 11 comments

When I compile for OSX, all is good app opens, everything working well. When I [cross-]compile for Windows it works all good, however I also get a command prompt window appearing. Is there any way to stop this happening? Reading around it suggests I can do this:

qtdeploy -ldflags -H=windowsgui -docker build windows_32_shared

however that doesnt seem to fix it.

Thanks

amlwwalker avatar Mar 12 '18 19:03 amlwwalker

Hey

Yeah, the command prompt should be already hidden on windows. (qtdeploy actually sets -H=windowsgui by default)

Does the prompt disappear when you use the windows_32_static image? Or some of the 64 bit images? Or if you deploy your application on windows while using the regular installation?

IIRC this was triggered by importing some sub-package, I will try to find the issue where this was first mentioned.

Could you maybe list the qt sub-package that you make use of?

therecipe avatar Mar 20 '18 15:03 therecipe

Found an related issue: https://github.com/therecipe/qt/issues/412

therecipe avatar Mar 26 '18 15:03 therecipe

Thanks for getting back to me, when I static compile I have the same issue, I am using a windows 7 32 bit VM.

Sure, how do I find the qt sub-package?

A

amlwwalker avatar Apr 02 '18 19:04 amlwwalker

You can run go list -f {{.Deps}} in the root folder of your project to get a list of all your dependencies. I just need a list of all the qt related packages you make use from. (widgets, qml, quick, ...)

therecipe avatar Apr 03 '18 16:04 therecipe

Cool, I think this is what you mean:

github.com/therecipe/qt
github.com/therecipe/qt/core
github.com/therecipe/qt/gui
github.com/therecipe/qt/network
github.com/therecipe/qt/qml
github.com/therecipe/qt/quick
github.com/therecipe/qt/widgets

amlwwalker avatar Apr 08 '18 19:04 amlwwalker

Thanks, I will look into this.

therecipe avatar Apr 09 '18 19:04 therecipe

Interesting, after changing away from an ApplicationWindow in the Qml, I no longer get the command prompt in windows. (At least that I think is the major change I can see...)

lol, now when I run it even from the command prompt, I can't see the logs 🤣

amlwwalker avatar Apr 11 '18 11:04 amlwwalker

Ah, I think that I got an idea. Will do some tests and report back.

therecipe avatar Apr 11 '18 18:04 therecipe

I made some changes, so now you should never see the command prompt at all on windows: https://github.com/therecipe/qt/commit/49a0021f932c3446cda48796e4871093d8189a66

Will look into how to handle this during development on windows.

therecipe avatar Apr 18 '18 15:04 therecipe

Yeah be cool to have a debug flag or something for this

amlwwalker avatar Apr 19 '18 15:04 amlwwalker

image

blakeyi avatar Jan 21 '22 07:01 blakeyi