1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Qtのデプロイ方法

Posted at

Qtでリリースビルドをする。

image.png

実行可能ファイルが出来上がるが、起動しても例外が出る。

例えば、リリースビルドで来た実行可能ファイルがudpChecker.exeだとして、これを叩いても、例外が出て怒られる。
image.png

Qt関係のDLLの色んなものがないと言われる
image.png

デプロイの処理をする。

デプロイ処理用のディレクトリを作り、ここに先ほどのビルドしている実行可能ファイルがudpChecker.exeと必要なINIなどの独自設定ファイルやその他の依存関係ライブラリを持ってくる。

image.png

次に、デプロイ用に、実行可能ファイルが参照しているQtの関係DLLファイルをかき集めてきてくれるツール(windeployqt.exe)を、デプロイ処理用のディレクトリに配置する。
image.png

windeployqt.exeは、『C:/QtフォルダのQtバージョンのディレクトリ/コンパイラ名/bin』の中にあるはず!

C:\Qt\6.4.0\mingw_64\bin 

コンパイラのバッチファイルのCLIから、デプロイ処理用のディレクトリをカーレントディレクトリにする。

image.png

image.png

コンパイラのバッチファイルのCLIから、windeployqt.exeのコマンド実行

windeployqt.exe udpChecker.exe

デプロイの処理が進む!
image.png

最後に、デプロイ処理用のディレクトリを確認すると、Qt関係のDLLなどが半自動的に配置してくれている!!

これを配布物としてやれば、デプロイのタスクは完了!!!!
image.png

参考:Linuxは下記のツールを使うこと。

linuxdeployqt

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?