qwindowkit icon indicating copy to clipboard operation
qwindowkit copied to clipboard

win10无法编译问题

Open zyjdmmm opened this issue 8 months ago • 4 comments

cmake -B build -S . \
-DCMAKE_PREFIX_PATH="D:/qt6.8/6.8.1/msvc2022_64" \
-Dqmsetup_DIR="D:/myfile/myproject/ohter_project/qwindowkit/qmsetup" \
-DQWINDOWKIT_BUILD_QUICK=TRUE \
-DCMAKE_INSTALL_PREFIX="D:/qwindowkit/install" \
-G "Ninja Multi-Config"

报错如下,究竟错在哪,我实在想不通为什么就是路径都会报错???

-- Configuring incomplete, errors occurred!
-DCMAKE_PREFIX_PATH=D:/qt6.8/6.8.1/msvc2022_64 : 无法将“-DCMAKE_PREFIX_PATH=
D:/qt6.8/6.8.1/msvc2022_64”项识别为 cmdlet、函数、脚本文件或可运行程序的名称
。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
所在位置 行:2 字符: 1
+ -DCMAKE_PREFIX_PATH="D:/qt6.8/6.8.1/msvc2022_64" \
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (-DCMAKE_PREFIX_...8.1/msvc202
   2_64:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

zyjdmmm avatar May 01 '25 13:05 zyjdmmm

完整报错:

CMake Warning:
  Ignoring extra path from command line:

   "\"


-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.
-- The CXX compiler identification is MSVC 19.42.34435.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring qmsetup...
-- Building qmsetup (Release)...
-- Installing qmsetup (Release)...
CMake Error at build/_install/lib/cmake/qmsetup/cmake/QMSetupAPI.cmake:238 (find_package):
  Could not find a package configuration file provided by "QT" with any of
  the following names:

    Qt6Config.cmake
    qt6-config.cmake
    Qt5Config.cmake
    qt5-config.cmake

  Add the installation prefix of "QT" to CMAKE_PREFIX_PATH or set "QT_DIR" to
  a directory containing one of the above files.  If "QT" provides a separate
  development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
  build/_install/lib/cmake/qmsetup/cmake/QMSetupAPI.cmake:256 (qm_find_qt)
  build/_install/lib/cmake/qmsetup/cmake/QMSetupAPI.cmake:410 (qm_link_qt)
  src/CMakeLists.txt:74 (qm_configure_target)
  src/core/CMakeLists.txt:92 (qwk_add_library)


-- Configuring incomplete, errors occurred!
-DCMAKE_PREFIX_PATH=D:/qt6.8/6.8.1/msvc2022_64 : 无法将“-DCMAKE_PREFIX_PATH=
D:/qt6.8/6.8.1/msvc2022_64”项识别为 cmdlet、函数、脚本文件或可运行程序的名称
。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
所在位置 行:2 字符: 1
+ -DCMAKE_PREFIX_PATH="D:/qt6.8/6.8.1/msvc2022_64" \
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (-DCMAKE_PREFIX_...8.1/msvc202
   2_64:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

-Dqmsetup_DIR=D:/myfile/myproject/ohter_project/qwindowkit/qmsetup : 无法将“
-Dqmsetup_DIR=D:/myfile/myproject/ohter_project/qwindowkit/qmsetup”项识别为
cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请
确保路径正确,然后再试一次。
所在位置 行:3 字符: 1
+ -Dqmsetup_DIR="D:/myfile/myproject/ohter_project/qwindowkit/qmsetup"  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (-Dqmsetup_DIR=D...ndowkit/qms
   etup:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

-DQWINDOWKIT_BUILD_QUICK=TRUE : 无法将“-DQWINDOWKIT_BUILD_QUICK=TRUE”项识别
为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,
请确保路径正确,然后再试一次。
所在位置 行:4 字符: 1
+ -DQWINDOWKIT_BUILD_QUICK=TRUE \
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (-DQWINDOWKIT_BUILD_QUICK=TRUE
   :String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

-DCMAKE_INSTALL_PREFIX=D:/qwindowkit/install : 无法将“-DCMAKE_INSTALL_PREFIX
=D:/qwindowkit/install”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请
检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
所在位置 行:5 字符: 1
+ -DCMAKE_INSTALL_PREFIX="D:/qwindowkit/install" \
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (-DCMAKE_INSTALL...ndowkit/ins
   tall:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

-G : 无法将“-G”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名
称的拼写,如果包括路径,请确保路径正确,然后再试一次。
所在位置 行:6 字符: 1
+ -G "Ninja Multi-Config"
+ ~~
    + CategoryInfo          : ObjectNotFound: (-G:String) [], CommandNotFoun
   dException
    + FullyQualifiedErrorId : CommandNotFoundException

zyjdmmm avatar May 01 '25 13:05 zyjdmmm

用批处理。powershell对于带双引号的参数,处理方式和批处理不一样,别用powershell。

wangwenx190 avatar May 03 '25 15:05 wangwenx190

用批处理。powershell对于带双引号的参数,处理方式和批处理不一样,别用powershell。

好的,谢谢。之前我一直都用的GUI没想过这个问题,但是我发现你这个引用了一个自己的项目。。。

zyjdmmm avatar May 08 '25 19:05 zyjdmmm

但是我发现你这个引用了一个自己的项目

什么意思,你说子模块?这个有什么影响?

wangwenx190 avatar May 10 '25 06:05 wangwenx190