Skip to content
This repository was archived by the owner on Sep 15, 2024. It is now read-only.

xmake环境: toolchain not found! #20

Closed
wulalal1 opened this issue Jun 15, 2024 · 9 comments
Closed

xmake环境: toolchain not found! #20

wulalal1 opened this issue Jun 15, 2024 · 9 comments
Assignees

Comments

@wulalal1
Copy link

Describe the bug | 问题描述

install the environment have problem

Desktop | 环境

To Reproduce | 复现步骤

PS D:\d2ds\dddd> xmake -v
checking for platform ... windows
checking for architecture ... x64
checking for Microsoft Visual Studio (x64) version ... no
checking for clang ... no
checking for zig ... no
checking for zig ... no
checking for nim ... no
checking for nim ... no
error: target(4.vector-0-1): toolchain not found!

xmake f -cvD
checking for platform ... windows
checking for architecture ... x64
checking for vswhere.exe ... C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe
checking for Microsoft Visual Studio (x64) version ... no
checkinfo: cannot runv(clang.exe --version), No such file or directory
checking for clang ... no
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(zig.exe version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(nim.exe --version), No such file or directory
checking for nim ... no
error: @programdir\core\main.lua:329: @programdir\actions\config\main.lua:157: target(3.array-5): toolchain not found!
stack traceback:
[C]: in function 'error'
[@programdir\core\base\os.lua:973]: in function 'raiselevel'
[@programdir\core\sandbox\modules\utils.lua:143]: in function 'assert'
[@programdir\actions\config\main.lua:157]: in function '_check_target_toolchains'
[@programdir\actions\config\main.lua:403]:
[C]: in function 'xpcall'
[@programdir\core\base\utils.lua:275]:
[@programdir\core\base\task.lua:491]: in function 'run'
[@programdir\core\main.lua:327]: in function 'cotask'
[@programdir\core\base\scheduler.lua:406]:

stack traceback:
[C]: in function 'error'
@programdir\core\base\os.lua:973: in function 'base/os.raiselevel'
(...tail calls...)
@programdir\core\main.lua:329: in upvalue 'cotask'
@programdir\core\base\scheduler.lua:406: in function <@programdir\core\base\scheduler.lua:399>
D:\d2ds\dddd>xmake g -c
configure
{
proxy_pac = pac.lua
network = public
theme = default
clean = true
}

Expection | 预期结果

Additional context | 额外补充

@Sunrisepeak
Copy link
Owner

@wulalal1

补充一下 vs 的信息到 - Desktop | 环境

在cmd控制台执行如下命令

cl
echo %PATH%

@Sunrisepeak Sunrisepeak self-assigned this Jun 15, 2024
@wulalal1
Copy link
Author

C:\Users\Administrator>echo %PATH%
C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;D:\mpi\Bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\Bandizip;E:\git\Git\cmd;D:.jdks\corretto-1.8.0_382\bin;D:.jdks\corretto-1.8.0_382\jre\bin;D:\apache-maven-3.6.3\bin;D:\mysql\mysql-8.1.0-winx64\bin;D:\nvm;D:\nvm\nodejs;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;E:\python\py;E:\pycharm\PyCharm 2023.2.1\bin;D:\nvm;C:\FWebRoot\vlc;C:\FWebRoot\Qt;E:\node\node_global;D:\nvm\nodejs;E:\新建文件 夹\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;E:\python\py;E:\pycharm\PyCharm 2023.2.1\bin;;D:\nvm;D:\nvm\nodejs;D:\vscode\Microsoft VS Code\bin;D:\gcc\mingw64\bin;;C:\Users\Administrator\xmake

@wulalal1
Copy link
Author

Visual Studio 2019

@wulalal1
Copy link
Author

C:\Users\Administrator>cl
用于 x64 的 Microsoft (R) C/C++ 优化编译器 19.29.30154 版
版权所有(C) Microsoft Corporation。保留所有权利。

用法: cl [ 选项... ] 文件名... [ /link 链接选项... ]

@Sunrisepeak
Copy link
Owner

C:\Users\Administrator>echo %PATH% C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;D:\mpi\Bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\Bandizip;E:\git\Git\cmd;D:.jdks\corretto-1.8.0_382\bin;D:.jdks\corretto-1.8.0_382\jre\bin;D:\apache-maven-3.6.3\bin;D:\mysql\mysql-8.1.0-winx64\bin;D:\nvm;D:\nvm\nodejs;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;E:\python\py;E:\pycharm\PyCharm 2023.2.1\bin;D:\nvm;C:\FWebRoot\vlc;C:\FWebRoot\Qt;E:\node\node_global;D:\nvm\nodejs;E:\新建文件 夹\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;E:\python\py;E:\pycharm\PyCharm 2023.2.1\bin;;D:\nvm;D:\nvm\nodejs;D:\vscode\Microsoft VS Code\bin;D:\gcc\mingw64\bin;;C:\Users\Administrator\xmake

E:\新建文件 夹\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64

vs是安装到了中文路径下吗, 可以换个英文路径试一试。win上中文路径可能会有编码问题

@Sunrisepeak
Copy link
Owner

@wulalal1
运行 vswhere 找不到安装的vs, 也可能是用户权限问题

image

microsoft/vswhere#310

@Sunrisepeak
Copy link
Owner

@wulalal1

重新安装vs后, 记得运行下面命令进行更新xmake配置

xmake g -c
xmake f -c
xmake

ref: xmake-io/xmake#3030

@wulalal1
Copy link
Author

[ 50%]: compiling.release dslings\tests\dslings.0.cpp
error: cl: 命令行 warning D9002 :忽略未知选项“-std:c++11”
dslings.0.cpp
dslings\tests\dslings.0.cpp(1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据
丢失
.\common/common.hpp(1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
.\common/common.hpp(10): fatal error C1083: 无法打开包括文件: “dstruct.hpp”: No such file or directory

@Sunrisepeak
Copy link
Owner

@wulalal1 clone 仓库的时候加上 --recursive

例如

git clone --recursive [email protected]:Sunrisepeak/d2ds.git

如果是 fork的仓库, 把地址换成fork的仓库地址即可

@Sunrisepeak Sunrisepeak changed the title xmake环境 xmake环境: toolchain not found! Jun 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants