Skip to content

Instantly share code, notes, and snippets.

@UnaNancyOwen
Last active December 21, 2021 18:05
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save UnaNancyOwen/e24e67966af5f1d5f5cce4a88af7b4a4 to your computer and use it in GitHub Desktop.
Save UnaNancyOwen/e24e67966af5f1d5f5cce4a88af7b4a4 to your computer and use it in GitHub Desktop.
How to use Qt that installed by Vcpkg with Qt Creator

How to use Qt that installed by Vcpkg with Qt Creator

(0) Install Qt using Vcpkg

Vcpkgを使用してQtをインストールする。(e.g. C:\vcpkg)

cd C:\vcpkg
.\vcpkg install qt5:x64-windows
(.\pkg install qt5:x86-windows)

CMakeを利用している場合、CMakeListsに以下の行を加えます。

set( CMAKE_TOOLCHAIN_FILE "C:/vcpkg/scripts/buildsystems/vcpkg.cmake" )

(1) Download and Install Qt Creator

以下のページからQt Creator(qt-creator-opensource-windows-x86_64-4.4.1.exe)をダウンロード、インストールする。

(2) Setting Qt that installed by Vcpkg to Qt Creator

  1. Qt Creatorのメニューから[Tools]>[Options...]を選択してオプションの設定画面を開く。

  2. オプションの設定画面から[Build & Run]を選択してビルド&実行の設定画面を開く。

  3. ビルド&実行の設定画面から[Qt Versions]タブを開き、[Add]ボタンを押す。
      VcpkgでインストールされたQMmake(vcpkg\installed\<triplet>\tools\qt5\qmake.exe)を選択して開く。

    2017-10-23_23h54_36

  4. ビルド&実行の設定画面から[Kits]タブを開き、[Add]ボタンを押す。
    以下の欄(Name、Compiler、Qt version)を設定する。

    • Name: Desktop (any name)
    • Compiler:
      • C: "Microsoft Visual C++ Compiler 15.0 (amd64)" (or "Microsoft Visual C++ Compiler 15.0 (amd64_x86)")
      • C++: "Microsoft Visual C++ Compiler 15.0 (amd64)" (or "Microsoft Visual C++ Compiler 15.0 (amd64_x86)")
    • Qt version: Qt 5.8.0 (qt5)

    2017-10-23_23h54_13

  5. [Apply]ボタンを押して設定を適用する。

@elvisdukaj
Copy link

Unfortunately, this doesn't work with QML.

QML debugging is enabled. Only use this in a safe environment.
QQmlApplicationEngine failed to load component
qrc:/qml/main.qml:1 plugin cannot be loaded for module "QtQuick": Cannot load library C:\projects\HyperBot\build-HyperBot-vcpkg_MSVC2017_64bit-Default\qml\QtQuick.2\qtquick2plugind.dll: Unable to load the specified file.

Do you have a solution for this?

@qaler
Copy link

qaler commented Nov 12, 2019

I believe the problem is raised due to qt creator could not find qmlscene('No qmlscene installed') in vcpkg, any idea how to solve this?

@aditya369007
Copy link

I believe the problem is raised due to qt creator could not find qmlscene('No qmlscene installed') in vcpkg, any idea how to solve this?

I am also facing the same issue, any fixes for this?

@maz-1
Copy link

maz-1 commented Jan 29, 2021

qt creator isn't aware of other tools from vcpkg like linguist, lupdate and lconvert as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment